:root {
  color-scheme: light;
  --ink: #10252f;
  --muted: #47606b;
  --surface: rgba(255, 255, 255, 0.9);
  --line: rgba(16, 37, 47, 0.12);
  --green: #22c55e;
  --green-dark: #11783b;
  --cyan: #67e8f9;
  --amber: #f6c453;
  --orange: #fb6b3b;
  --purple: #8b5cf6;
  --danger: #ef4444;
  --shadow: 0 18px 45px rgba(12, 34, 28, 0.18);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(227, 248, 239, 0.94), rgba(223, 241, 252, 0.86)),
    url("/assets/green-valley-bg.png") center / cover fixed;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.avatar-option:focus-visible,
.choice:focus-within {
  outline: 3px solid rgba(34, 197, 94, 0.42);
  outline-offset: 3px;
}

.student-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px 16px;
}

.student-panel {
  width: min(100%, 760px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.student-header {
  padding: 28px 24px 18px;
  background:
    linear-gradient(120deg, rgba(22, 163, 74, 0.16), rgba(103, 232, 249, 0.18)),
    rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 0.875rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 2rem;
  line-height: 1.2;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.student-app {
  padding: 24px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.field label,
.section-label {
  font-weight: 700;
}

.field input,
.group-select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.group-select {
  appearance: auto;
}

.avatar-grid,
.commit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 22px;
}

.avatar-option,
.commit-option,
.choice {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.avatar-option,
.commit-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.avatar-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #e7f8ec, #d8f2ff);
  color: var(--green-dark);
  font-weight: 800;
  overflow: hidden;
}

.avatar-mark img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  display: block;
}

.avatar-rabbit img,
.avatar-squirrel img,
.avatar-deer img,
.avatar-bird img,
.avatar-fox img {
  transform: translateY(-5px);
}

.avatar-deer img {
  transform: translateY(-6px);
}

.avatar-bird img {
  transform: translateY(-7px);
}

.avatar-mark.large {
  width: 88px;
  height: 88px;
  flex-basis: 88px;
}

.avatar-mark.chip {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 6px;
}

.fallback-mark {
  padding-top: 1px;
}

.is-selected {
  border-color: rgba(34, 197, 94, 0.8);
  background: rgba(240, 253, 244, 0.96);
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.16);
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, #22c55e, #14b8a6);
  color: #ffffff;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ghost-button {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--green-dark);
}

.mission-copy {
  display: grid;
  gap: 12px;
  line-height: 1.7;
}

.question-list {
  display: grid;
  gap: 18px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.question-card h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
  line-height: 1.45;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-top: 8px;
  line-height: 1.45;
}

.choice input {
  margin-top: 3px;
  accent-color: var(--green);
}

.feedback-card {
  display: grid;
  gap: 16px;
  text-align: center;
}

.feedback-avatar {
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  margin: 0 auto;
  border-radius: 8px;
  background: linear-gradient(145deg, #dcfce7, #cffafe);
  color: var(--green-dark);
  font-size: 1.75rem;
  font-weight: 900;
  overflow: hidden;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.score-strip div,
.suggestions {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.suggestions {
  text-align: left;
  line-height: 1.7;
}

.feedback-notes {
  display: grid;
  gap: 10px;
}

.suggestions ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.suggestions p {
  margin: 8px 0 0;
}

.encouragement-note {
  border-color: rgba(34, 197, 94, 0.28);
  background:
    linear-gradient(180deg, rgba(240, 253, 244, 0.9), rgba(255, 255, 255, 0.78)),
    rgba(255, 255, 255, 0.78);
}

.teacher-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  background: #07131d;
  overflow: auto;
  padding: 12px;
}

.teacher-stage {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  --dashboard-panel-left: 35.7%;
  --dashboard-panel-top: 22.9%;
  --dashboard-panel-width: 27.4%;
  --dashboard-panel-height: 51.4%;
  --battle-overlay-center-x: 50%;
  width: min(100%, 177.78dvh);
  max-width: 1600px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #06101a;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.teacher-page:has(.teacher-stage.is-sorting-active:not(.is-promise-active)),
.teacher-page:has(.teacher-stage.is-sorting-finished:not(.is-promise-active)) {
  align-items: start;
  overflow: auto;
  padding: 0 12px 12px;
}

.teacher-stage.is-sorting-active:not(.is-promise-active),
.teacher-stage.is-sorting-finished:not(.is-promise-active) {
  width: min(100%, 1600px);
  aspect-ratio: auto;
  min-height: 100dvh;
  overflow: visible;
  box-shadow: none;
}

.teacher-page:has(.teacher-stage.is-promise-active) {
  place-items: stretch;
  overflow: hidden;
  padding: 0;
}

.teacher-stage.is-promise-active {
  width: 100%;
  max-width: none;
  height: 100dvh;
  aspect-ratio: auto;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
}

.teacher-stage [hidden] {
  display: none !important;
}

.teacher-stage.is-assembly {
  background: #000000;
}

.teacher-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #000000;
  opacity: 0;
  transform: scale(1.002);
  transition: opacity 360ms ease-out;
}

.teacher-stage.is-assembly::before {
  opacity: 1;
}

.teacher-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 360ms ease-out;
}

.assembly-code-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms ease-out;
}

.is-assembly .assembly-code-bg {
  opacity: 1;
}

.is-dashboard .assembly-code-bg {
  opacity: 0;
}

.code-stars {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 9% 19%, rgba(116, 221, 255, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 23% 8%, rgba(92, 134, 255, 0.7) 0 1px, transparent 2px),
    radial-gradient(circle at 41% 30%, rgba(244, 114, 255, 0.65) 0 1px, transparent 2px),
    radial-gradient(circle at 67% 12%, rgba(34, 211, 238, 0.85) 0 1.2px, transparent 2.5px),
    radial-gradient(circle at 83% 28%, rgba(217, 70, 239, 0.75) 0 1px, transparent 2px),
    radial-gradient(circle at 92% 9%, rgba(34, 211, 238, 0.7) 0 1px, transparent 2px),
    radial-gradient(circle at 53% 46%, rgba(255, 255, 255, 0.9) 0 1.4px, transparent 3px);
  opacity: 0.8;
}

.code-top-circuit {
  position: absolute;
  top: 4.7%;
  left: 0;
  width: 13%;
  height: 3.4%;
  background:
    linear-gradient(135deg, transparent 0 16%, rgba(35, 98, 255, 0.55) 16% 21%, transparent 21%),
    linear-gradient(90deg, transparent 0 55%, rgba(34, 211, 238, 0.36) 55% 82%, transparent 82%),
    linear-gradient(180deg, transparent 0 45%, rgba(55, 111, 255, 0.5) 45% 58%, transparent 58%);
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.38));
  opacity: 0.8;
}

.code-hud-arcs {
  position: absolute;
  top: 2.2%;
  left: 41.5%;
  width: 45%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(from 190deg, transparent 0 54%, rgba(34, 211, 238, 0.72) 56% 61%, rgba(125, 92, 255, 0.78) 63% 68%, rgba(217, 70, 239, 0.68) 69% 73%, transparent 75% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent 0 66%, #000 67% 71%, transparent 72% 100%);
  mask: radial-gradient(farthest-side, transparent 0 66%, #000 67% 71%, transparent 72% 100%);
  filter: drop-shadow(0 0 18px rgba(34, 211, 238, 0.3));
  opacity: 0.92;
}

.code-hud-arcs::before,
.code-hud-arcs::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px dashed rgba(89, 178, 255, 0.22);
}

.code-hud-arcs::after {
  inset: 23%;
  border-color: rgba(217, 70, 239, 0.28);
  transform: rotate(24deg);
}

.code-dots {
  position: absolute;
  width: 7%;
  height: 12%;
  background: radial-gradient(circle, rgba(34, 244, 255, 0.86) 0 1.8px, transparent 2.2px) 0 0 / 13px 13px;
  filter: drop-shadow(0 0 7px rgba(34, 211, 238, 0.42));
  opacity: 0.9;
}

.code-dots-left {
  left: 0.9%;
  top: 51.6%;
}

.code-dots-right {
  right: 1.2%;
  top: 55.5%;
}

.code-horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 43.8%;
  height: 25%;
  background:
    radial-gradient(ellipse at 54% 24%, rgba(255, 255, 255, 0.92), rgba(34, 211, 238, 0.68) 4%, rgba(99, 102, 241, 0.26) 18%, transparent 38%),
    linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.22) 36%, rgba(255, 255, 255, 0.42) 54%, rgba(217, 70, 239, 0.18) 72%, transparent);
  filter: blur(0.1px);
}

.code-mountains {
  position: absolute;
  left: -3%;
  right: -3%;
  bottom: 40.2%;
  height: 16%;
  clip-path: polygon(0 100%, 0 48%, 6% 56%, 13% 46%, 21% 55%, 28% 42%, 36% 52%, 45% 37%, 53% 52%, 61% 42%, 70% 54%, 79% 34%, 90% 51%, 100% 35%, 100% 100%);
}

.code-mountains-back {
  bottom: 43.2%;
  background: linear-gradient(180deg, rgba(48, 83, 176, 0.44), rgba(14, 26, 74, 0.72));
  opacity: 0.8;
}

.code-mountains-front {
  height: 19%;
  background: linear-gradient(180deg, rgba(28, 55, 129, 0.82), rgba(4, 12, 36, 0.94));
  opacity: 0.95;
}

.code-road {
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: -10%;
  height: 58%;
  overflow: hidden;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.6), transparent 12%),
    linear-gradient(112deg, transparent 0 37%, rgba(34, 211, 238, 0.78) 37.2% 37.55%, transparent 38%),
    linear-gradient(106deg, transparent 0 42%, rgba(125, 92, 255, 0.62) 42.2% 42.45%, transparent 42.9%),
    linear-gradient(100deg, transparent 0 46%, rgba(34, 244, 255, 0.78) 46.18% 46.42%, transparent 46.9%),
    linear-gradient(82deg, transparent 0 53%, rgba(244, 76, 255, 0.66) 53.2% 53.45%, transparent 53.9%),
    linear-gradient(76deg, transparent 0 58%, rgba(56, 189, 248, 0.76) 58.15% 58.42%, transparent 58.9%),
    linear-gradient(69deg, transparent 0 64%, rgba(217, 70, 239, 0.64) 64.2% 64.5%, transparent 65%),
    linear-gradient(90deg, rgba(15, 60, 180, 0.16), transparent 42%, transparent 58%, rgba(217, 70, 239, 0.15));
}

.code-road::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, transparent 0 31%, rgba(34, 211, 238, 0.32) 31.2% 31.55%, transparent 32%),
    linear-gradient(62deg, transparent 0 68%, rgba(244, 76, 255, 0.3) 68.2% 68.5%, transparent 69%),
    linear-gradient(94deg, transparent 0 48%, rgba(255, 255, 255, 0.34) 48.1% 48.3%, transparent 48.8%),
    linear-gradient(86deg, transparent 0 52%, rgba(255, 255, 255, 0.26) 52.1% 52.3%, transparent 52.8%),
    radial-gradient(ellipse at 50% 0%, rgba(34, 211, 238, 0.44), transparent 26%);
  mix-blend-mode: screen;
}

.code-road::after {
  content: "";
  position: absolute;
  left: 49.75%;
  top: -28%;
  width: 0.55%;
  height: 62%;
  background: linear-gradient(180deg, transparent, #ffffff 23%, #22f4ff 47%, transparent);
  box-shadow:
    0 0 14px rgba(255, 255, 255, 0.85),
    0 0 34px rgba(34, 211, 238, 0.82),
    0 0 62px rgba(99, 102, 241, 0.5);
}

.road-line {
  position: absolute;
  left: 50%;
  top: -4%;
  width: 1.5px;
  height: 140%;
  transform-origin: 50% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(34, 211, 238, 0.52) 18%, rgba(34, 211, 238, 0.92) 72%, transparent);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.7);
}

.road-line:nth-child(1) { transform: rotate(-66deg); background: linear-gradient(180deg, rgba(34, 211, 238, 0.2), #22d3ee 62%, transparent); }
.road-line:nth-child(2) { transform: rotate(-54deg); background: linear-gradient(180deg, rgba(217, 70, 239, 0.22), #d946ef 62%, transparent); }
.road-line:nth-child(3) { transform: rotate(-43deg); }
.road-line:nth-child(4) { transform: rotate(-33deg); background: linear-gradient(180deg, rgba(34, 211, 238, 0.2), #38bdf8 62%, transparent); }
.road-line:nth-child(5) { transform: rotate(-23deg); background: linear-gradient(180deg, rgba(217, 70, 239, 0.2), #a855f7 62%, transparent); }
.road-line:nth-child(6) { transform: rotate(-14deg); }
.road-line:nth-child(7) { transform: rotate(-7deg); background: linear-gradient(180deg, #ffffff, #22f4ff 58%, transparent); }
.road-line:nth-child(8) { width: 3px; transform: rotate(-2deg); background: linear-gradient(180deg, #ffffff, #60a5fa 58%, transparent); }
.road-line:nth-child(9) { width: 3px; transform: rotate(2deg); background: linear-gradient(180deg, #ffffff, #c084fc 58%, transparent); }
.road-line:nth-child(10) { transform: rotate(7deg); background: linear-gradient(180deg, #ffffff, #22f4ff 58%, transparent); }
.road-line:nth-child(11) { transform: rotate(14deg); }
.road-line:nth-child(12) { transform: rotate(23deg); background: linear-gradient(180deg, rgba(217, 70, 239, 0.2), #d946ef 62%, transparent); }
.road-line:nth-child(13) { transform: rotate(33deg); background: linear-gradient(180deg, rgba(34, 211, 238, 0.2), #38bdf8 62%, transparent); }
.road-line:nth-child(14) { transform: rotate(43deg); }
.road-line:nth-child(15) { transform: rotate(54deg); background: linear-gradient(180deg, rgba(217, 70, 239, 0.22), #f04cff 62%, transparent); }
.road-line:nth-child(16) { transform: rotate(66deg); background: linear-gradient(180deg, rgba(34, 211, 238, 0.2), #22d3ee 62%, transparent); }

.is-dashboard .dashboard-bg {
  opacity: 1;
}

.teacher-stage.is-dashboard {
  border-radius: 0;
}

.assembly-lightfall,
.dashboard-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 360ms ease-out;
}

.assembly-lightfall canvas,
.dashboard-particles canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.assembly-lightfall {
  opacity: 1;
}

.dashboard-particles {
  opacity: 0;
}

.is-dashboard .assembly-lightfall {
  opacity: 0;
}

.is-dashboard .dashboard-particles {
  opacity: 0;
}

.is-assembly .dashboard-particles {
  opacity: 0;
}

.dashboard-bin-characters {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 280ms ease-out;
}

.is-dashboard.is-sorting-active .dashboard-bin-characters,
.is-dashboard.is-sorting-finished .dashboard-bin-characters {
  opacity: 0;
  visibility: hidden;
}

.dashboard-bin-character {
  position: absolute;
  width: clamp(76px, 7.4cqw, 150px);
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 14px 22px rgba(0, 0, 0, 0.38))
    drop-shadow(0 0 16px rgba(125, 245, 255, 0.14));
}

.dashboard-bin-recyclable {
  left: 28.5%;
  top: 45.5%;
}

.dashboard-bin-kitchen {
  left: 35.8%;
  top: 52.4%;
  width: clamp(72px, 6.8cqw, 136px);
}

.dashboard-bin-hazardous {
  right: 26.8%;
  top: 44.2%;
}

.dashboard-bin-other {
  right: 17.2%;
  top: 54.6%;
  width: clamp(72px, 6.8cqw, 136px);
}

.teacher-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.04), rgba(5, 20, 32, 0.36) 46%, rgba(0, 0, 0, 0.02)),
    linear-gradient(0deg, rgba(3, 9, 15, 0.22), transparent 38%);
}

.teacher-stage.is-assembly::after {
  background: none;
}

.teacher-stage.is-dashboard::after {
  background: none;
}

.center-hud,
.energy-panel,
.roster-panel,
.word-panel,
.assembly-layer {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(145, 224, 255, 0.42);
  border-radius: 8px;
  background: rgba(8, 26, 38, 0.54);
  color: #ecfeff;
  box-shadow: 0 0 22px rgba(103, 232, 249, 0.18);
  backdrop-filter: blur(4px);
}

.dashboard-layer {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 240ms ease-out, transform 240ms ease-out;
}

.is-assembly .dashboard-layer {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.is-dashboard .assembly-layer {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
}

.is-dashboard.is-sorting-active .center-hud,
.is-dashboard.is-sorting-active .shield-energy,
.is-dashboard.is-sorting-active .monster-energy,
.is-dashboard.is-sorting-active .word-panel,
.is-dashboard.is-sorting-finished .center-hud,
.is-dashboard.is-sorting-finished .shield-energy,
.is-dashboard.is-sorting-finished .monster-energy,
.is-dashboard.is-sorting-finished .word-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.assembly-layer {
  inset: 0;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transition: opacity 240ms ease-out, transform 240ms ease-out;
}

.assembly-copy,
.assembly-counter {
  color: #f8fbff;
}

.assembly-copy {
  position: absolute;
  left: 5.8%;
  top: 9%;
  z-index: 3;
  width: 47%;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  filter: none;
}

.assembly-copy h1 {
  margin-bottom: 22px;
  color: #f8ffff;
  font-size: clamp(3.4rem, 5.55cqw, 5.7rem);
  font-weight: 900;
  line-height: 0.98;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.assembly-copy p:last-child {
  width: 82%;
  max-width: none;
  margin-bottom: 0;
  color: #f3f7ff;
  font-size: clamp(1.25rem, 1.78cqw, 2rem);
  font-weight: 800;
  line-height: 1.52;
  text-shadow:
    0 0 10px rgba(11, 24, 67, 0.86),
    0 0 18px rgba(34, 211, 238, 0.28);
}

.assembly-copy .eyebrow {
  display: none;
}

.assembly-counter {
  position: absolute;
  top: 8.4%;
  right: 4.8%;
  display: flex;
  width: 15.3%;
  min-width: 132px;
  height: 12.9%;
  min-height: 70px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.1cqw, 18px);
  padding: 12px 18px;
  border: 2px solid rgba(34, 211, 238, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(8, 26, 78, 0.48), rgba(34, 16, 86, 0.24)),
    rgba(3, 10, 33, 0.28);
  text-align: center;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.11),
    inset 0 0 22px rgba(34, 211, 238, 0.08),
    0 0 22px rgba(34, 211, 238, 0.42),
    0 0 40px rgba(99, 102, 241, 0.22);
  backdrop-filter: blur(2px);
}

.assembly-counter::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(124, 227, 255, 0.38);
  border-radius: 7px;
  clip-path: polygon(0 0, 22% 0, 22% 8%, 8% 8%, 8% 32%, 0 32%, 0 0, 100% 0, 100% 28%, 92% 28%, 92% 8%, 72% 8%, 72% 0, 100% 0, 100% 100%, 72% 100%, 72% 92%, 92% 92%, 92% 72%, 100% 72%, 100% 100%, 0 100%, 0 72%, 8% 72%, 8% 92%, 28% 92%, 28% 100%, 0 100%);
  box-shadow: inset 0 0 16px rgba(34, 211, 238, 0.32);
}

.assembly-counter::after {
  content: "";
  position: absolute;
  inset: auto 17px 9px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.94), rgba(217, 70, 239, 0.48), transparent);
}

.assembly-counter span {
  position: relative;
  z-index: 1;
  color: #f4f8ff;
  font-size: clamp(1rem, 1.42cqw, 1.48rem);
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(34, 211, 238, 0.52);
}

.assembly-counter strong {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: clamp(3.35rem, 5.15cqw, 5.4rem);
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.92),
    0 0 22px rgba(34, 211, 238, 0.92),
    0 0 44px rgba(99, 102, 241, 0.6);
}

.assembly-counter b {
  color: #eefbff;
}

.assembly-roster {
  position: absolute;
  top: 78.8%;
  left: 29.2%;
  right: 26%;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  height: 9.6%;
  align-content: center;
  justify-content: center;
  gap: 10px 12px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.has-assembly-students .assembly-roster {
  top: 32.5%;
  left: 9%;
  right: 9%;
  height: 21%;
  padding: 6px 10px;
}

.assembly-empty {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 100%;
  place-items: center;
  border: 2px solid rgba(116, 221, 255, 0.86);
  border-radius: 6px;
  background:
    linear-gradient(110deg, rgba(10, 24, 88, 0.48), rgba(9, 39, 139, 0.42) 62%, rgba(15, 17, 83, 0.5)),
    rgba(6, 14, 48, 0.34);
  color: #ffffff;
  font-size: clamp(1.08rem, 1.74cqw, 2rem);
  font-weight: 900;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.38),
    0 0 20px rgba(34, 211, 238, 0.38);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 0 22px rgba(34, 211, 238, 0.08),
    0 0 16px rgba(34, 211, 238, 0.26),
    0 0 28px rgba(99, 102, 241, 0.16);
  backdrop-filter: blur(1px);
  clip-path: polygon(7% 0, 97% 0, 100% 50%, 96% 100%, 3% 100%, 0 50%, 4% 0);
}

.assembly-empty::after {
  content: none;
}

.assembly-status-banner {
  position: absolute;
  top: 78.8%;
  left: 29.2%;
  right: 26%;
  width: auto;
  height: 9.6%;
  min-height: 0;
  z-index: 2;
  font-family: inherit;
  cursor: default;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
  touch-action: manipulation;
}

.has-assembly-students .assembly-status-banner {
  cursor: pointer;
  border-color: rgba(165, 243, 252, 0.92);
  background:
    linear-gradient(110deg, rgba(6, 33, 93, 0.6), rgba(15, 73, 162, 0.52) 60%, rgba(45, 24, 126, 0.58)),
    rgba(6, 14, 48, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 0 24px rgba(34, 211, 238, 0.12),
    0 0 22px rgba(34, 211, 238, 0.34),
    0 0 34px rgba(99, 102, 241, 0.2);
}

.has-assembly-students .assembly-status-banner:hover,
.has-assembly-students .assembly-status-banner:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 0 28px rgba(34, 211, 238, 0.18),
    0 0 28px rgba(34, 211, 238, 0.44),
    0 0 42px rgba(217, 70, 239, 0.22);
}

.has-assembly-students .assembly-status-banner:active {
  transform: translateY(0) scale(0.995);
}

.assembly-status-banner:disabled {
  cursor: default;
}

.assembly-student {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 78px;
  min-width: 78px;
  min-height: 86px;
  border: 1px solid rgba(94, 234, 212, 0.34);
  border-radius: 8px;
  padding: 8px 6px 7px;
  background:
    radial-gradient(circle at 50% 8%, rgba(34, 211, 238, 0.2), transparent 46%),
    linear-gradient(150deg, rgba(14, 45, 92, 0.56), rgba(50, 23, 92, 0.4));
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 22px rgba(34, 211, 238, 0.14);
  backdrop-filter: blur(2px);
  transform-origin: center;
  opacity: 0;
  transform: translate(var(--from-x, 0), var(--from-y, 0)) scale(0.22);
  will-change: transform, opacity, filter;
}

.assembly-student.is-launched {
  animation: centerBurst 720ms cubic-bezier(0.18, 0.88, 0.2, 1.04) both;
  animation-delay: var(--launch-delay, 0ms);
}

.assembly-student.is-settled {
  opacity: 1;
  transform: none;
  will-change: auto;
}

.assembly-student span {
  width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-mark.assembly {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(145deg, rgba(226, 252, 255, 0.95), rgba(216, 219, 255, 0.92));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.22);
}

.assembly-actions {
  position: absolute;
  left: 50%;
  top: 73.4%;
  display: grid;
  grid-template-columns: 1fr;
  width: min(34%, 430px);
  min-width: 320px;
  transform: translateX(-50%);
  padding: 10px 22px 11px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(3, 12, 31, 0.16), rgba(8, 18, 56, 0.48) 18%, rgba(25, 14, 62, 0.52) 82%, rgba(3, 12, 31, 0.16));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 34px rgba(34, 211, 238, 0.18),
    0 0 38px rgba(217, 70, 239, 0.14);
  clip-path: polygon(7% 0, 93% 0, 100% 50%, 93% 100%, 7% 100%, 0 50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease-out;
}

.has-assembly-students .assembly-actions {
  opacity: 1;
  pointer-events: auto;
}

.primary-glow {
  border: 1px solid rgba(165, 243, 252, 0.36);
  background: linear-gradient(135deg, #22d3ee, #6366f1 54%, #d946ef);
  color: #ffffff;
  box-shadow:
    0 0 22px rgba(34, 211, 238, 0.42),
    0 0 34px rgba(217, 70, 239, 0.18);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.38);
}

@keyframes centerBurst {
  0% {
    opacity: 0;
    filter: blur(10px) brightness(1.8);
    transform: translate(var(--from-x, 0), var(--from-y, 0)) scale(0.22);
  }
  68% {
    opacity: 1;
    filter: blur(0) brightness(1.2);
    transform: translate(0, -7px) scale(1.08);
  }
  100% {
    opacity: 1;
    filter: blur(0) brightness(1);
    transform: translateY(0) scale(1);
  }
}

.panel-title,
.energy-label span {
  color: #a7f3d0;
  font-size: 0.78rem;
  font-weight: 800;
}

.center-hud {
  top: calc(34.2% + 6cqw);
  left: var(--battle-overlay-center-x);
  width: 16.8%;
  height: 15.4%;
  display: block;
  padding: 0;
  text-align: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
  transform: translateX(-50%);
}

.center-hud.dashboard-layer {
  transform: translateX(-50%);
}

.center-hud::before {
  content: "";
  position: absolute;
  left: 15.5%;
  right: 14.5%;
  top: 44.7%;
  height: 44%;
  border: 1px solid rgba(152, 233, 255, 0.46);
  border-radius: 5px;
  background:
    radial-gradient(circle at 50% 72%, rgba(173, 238, 255, 0.26), transparent 45%),
    linear-gradient(180deg, rgba(123, 224, 255, 0.15), rgba(30, 91, 118, 0.1) 52%, rgba(11, 31, 48, 0.03)),
    rgba(93, 190, 218, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 34px rgba(103, 232, 249, 0.16),
    0 0 22px rgba(103, 232, 249, 0.18),
    0 0 34px rgba(94, 234, 212, 0.08);
  pointer-events: none;
}

.center-hud::after {
  content: "";
  position: absolute;
  left: 15.5%;
  right: 14.5%;
  top: 44.7%;
  height: 44%;
  border-radius: 5px;
  background:
    linear-gradient(#8ff7ff, #8ff7ff) left top / 28px 2px no-repeat,
    linear-gradient(#8ff7ff, #8ff7ff) right top / 28px 2px no-repeat,
    linear-gradient(#8ff7ff, #8ff7ff) left bottom / 28px 2px no-repeat,
    linear-gradient(#8ff7ff, #8ff7ff) right bottom / 28px 2px no-repeat,
    linear-gradient(#8ff7ff, #8ff7ff) left top / 2px 28px no-repeat,
    linear-gradient(#8ff7ff, #8ff7ff) right top / 2px 28px no-repeat,
    linear-gradient(#8ff7ff, #8ff7ff) left bottom / 2px 28px no-repeat,
    linear-gradient(#8ff7ff, #8ff7ff) right bottom / 2px 28px no-repeat,
    linear-gradient(90deg, transparent, rgba(167, 246, 93, 0.4), transparent) center 35% / 64% 1px no-repeat;
  opacity: 0.72;
  filter: drop-shadow(0 0 8px rgba(103, 232, 249, 0.45));
  pointer-events: none;
}

.center-hud::before,
.center-hud::after {
  display: none;
}

.center-hud .eyebrow {
  position: absolute;
  z-index: 1;
  top: 47.5%;
  left: 50%;
  width: auto;
  min-width: 62%;
  padding: 5px 14px 6px;
  border: 1px solid rgba(132, 255, 100, 0.24);
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, rgba(57, 255, 91, 0.1), transparent);
  transform: translateX(-50%);
  color: #72f266;
  font-size: clamp(1.68rem, 2.28cqw, 2.7rem);
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 0 10px rgba(57, 255, 91, 0.55),
    0 0 20px rgba(34, 197, 94, 0.28);
}

.index-row {
  position: absolute;
  z-index: 1;
  top: 64.1%;
  left: 50%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0;
  min-height: 0;
  transform: translateX(-50%);
}

.index-row::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  width: 1.18em;
  height: 1.18em;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), rgba(103, 232, 249, 0.14) 46%, transparent 68%);
  filter: blur(1px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.index-row strong {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: clamp(5.65rem, 7.35cqw, 8.3rem);
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.45),
    0 0 22px rgba(103, 232, 249, 0.42),
    0 0 34px rgba(167, 246, 93, 0.18);
}

.index-row span {
  display: none;
}

.dashboard-message {
  display: none;
}

.mini-metrics {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  height: 100%;
  transform: none;
}

.mini-metrics > span {
  --metric-accent: #67e8f9;
  --metric-accent-soft: rgba(103, 232, 249, 0.22);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(180, 236, 255, 0.52);
  border-radius: 8px;
  padding: 8px 12px 10px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(220, 251, 255, 0.28), rgba(44, 105, 132, 0.12) 58%, rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 50% -16%, rgba(255, 255, 255, 0.34), transparent 42%),
    rgba(17, 46, 64, 0.28);
  color: #ffffff;
  font-size: clamp(1.65rem, 2.03cqw, 2.31rem);
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 0 rgba(103, 232, 249, 0.32),
    inset 0 0 28px var(--metric-accent-soft),
    0 0 18px rgba(103, 232, 249, 0.18);
  line-height: 1.15;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.28);
}

.mini-metrics > span::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent 0 9%, var(--metric-accent) 9% 21%, transparent 21% 79%, var(--metric-accent) 79% 91%, transparent 91%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 45%);
  opacity: 0.62;
  pointer-events: none;
}

.mini-metrics > span::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--metric-accent), transparent);
  box-shadow: 0 0 12px var(--metric-accent);
  pointer-events: none;
}

.mini-metrics .metric-label,
.mini-metrics .metric-value {
  position: relative;
  z-index: 1;
  height: auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.mini-metrics .metric-label {
  color: #d9fbff;
  font-size: clamp(1rem, 1.05cqw, 1.3rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(103, 232, 249, 0.42);
}

.mini-metrics .metric-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  color: #ffffff;
  font-size: clamp(1.24rem, 1.48cqw, 1.76rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.mini-metrics .metric-total {
  color: #dcf7ff;
  font-size: 0.82em;
  font-weight: 800;
  line-height: 1;
  opacity: 0.9;
}

.mini-metrics strong {
  display: inline;
  margin-top: 0;
  color: #ffffff;
  font-size: clamp(2.05rem, 2.55cqw, 3.05rem);
  font-weight: 800;
  line-height: 1;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.42),
    0 0 18px var(--metric-accent);
}

.sorting-start-panel {
  left: 33%;
  top: 26%;
  width: 34%;
  min-height: 24%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  border-color: rgba(190, 242, 100, 0.48);
  background:
    radial-gradient(circle at 50% 0%, rgba(190, 242, 100, 0.24), transparent 55%),
    rgba(5, 24, 31, 0.72);
}

.sorting-start-panel.is-test-mode {
  left: 3%;
  right: auto;
  top: 7%;
  width: min(330px, 30%);
  min-height: auto;
  z-index: 12;
  gap: 10px;
  padding: 18px;
  border-color: rgba(125, 211, 252, 0.72);
  background:
    radial-gradient(circle at 100% 0%, rgba(125, 211, 252, 0.26), transparent 58%),
    rgba(5, 24, 31, 0.88);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.sorting-start-panel.is-test-mode h2 {
  font-size: clamp(1rem, 1.25cqw, 1.28rem);
}

.sorting-start-panel h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.45rem, 2.05cqw, 2.45rem);
  line-height: 1.22;
}

.temporary-sorting-shortcut {
  position: absolute;
  right: 2.6%;
  bottom: 3%;
  z-index: 20;
  width: auto;
  min-width: 150px;
  padding-inline: 20px;
  opacity: 1;
  transform: none;
  border-color: rgba(125, 211, 252, 0.78);
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.92), rgba(34, 197, 94, 0.88));
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.32),
    0 0 24px rgba(125, 211, 252, 0.38);
}

.sorting-dashboard {
  left: 6%;
  right: 6%;
  bottom: 5%;
  height: 28%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: 1.1fr 0.8fr 0.8fr 1.3fr 1fr 1.1fr;
  gap: 10px;
  padding: 14px;
  border-color: rgba(125, 211, 252, 0.45);
  background:
    linear-gradient(180deg, rgba(8, 31, 43, 0.76), rgba(5, 16, 24, 0.58)),
    radial-gradient(circle at 18% 0%, rgba(132, 255, 100, 0.18), transparent 46%);
}

.is-dashboard.is-sorting-active .sorting-dashboard,
.is-dashboard.is-sorting-finished .sorting-dashboard {
  top: 8%;
  left: 7%;
  right: 7%;
  bottom: auto;
  height: 82%;
  grid-template-columns: 1.05fr 0.95fr 0.95fr;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: clamp(18px, 2cqw, 30px);
  border-color: rgba(186, 230, 253, 0.62);
  background:
    radial-gradient(circle at 50% 0%, rgba(34, 211, 238, 0.2), transparent 52%),
    linear-gradient(180deg, rgba(5, 22, 34, 0.88), rgba(4, 15, 24, 0.72));
  box-shadow:
    0 20px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 0 38px rgba(103, 232, 249, 0.12);
  backdrop-filter: blur(6px);
}

.is-dashboard.is-sorting-active .sorting-status-strip,
.is-dashboard.is-sorting-finished .sorting-status-strip {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(186, 230, 253, 0.18);
}

.is-dashboard.is-sorting-active .sorting-stat,
.is-dashboard.is-sorting-active .mistake-board,
.is-dashboard.is-sorting-active .group-board,
.is-dashboard.is-sorting-finished .sorting-stat,
.is-dashboard.is-sorting-finished .mistake-board,
.is-dashboard.is-sorting-finished .group-board {
  display: grid;
  align-content: center;
  padding: clamp(14px, 1.6cqw, 24px);
}

.is-dashboard.is-sorting-active .sorting-stat.primary,
.is-dashboard.is-sorting-finished .sorting-stat.primary {
  grid-row: span 2;
}

.is-dashboard.is-sorting-active .category-grid,
.is-dashboard.is-sorting-finished .category-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: stretch;
}

.sorting-status-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.sorting-status-strip span {
  color: #bbf7d0;
  font-size: clamp(0.84rem, 1.05cqw, 1.2rem);
  font-weight: 900;
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.32);
}

.sorting-status-strip .ghost-button {
  min-height: 34px;
  padding: 6px 12px;
  color: #e0f2fe;
  border-color: rgba(186, 230, 253, 0.36);
  background: rgba(15, 23, 42, 0.4);
}

.sorting-stat,
.mistake-board,
.group-board {
  min-width: 0;
  border: 1px solid rgba(186, 230, 253, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: rgba(7, 22, 32, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.sorting-stat span,
.mistake-board span,
.group-board span {
  display: block;
  color: #b9f6ff;
  font-size: clamp(0.76rem, 0.95cqw, 1.08rem);
  font-weight: 800;
}

.sorting-stat strong {
  display: block;
  margin-top: 5px;
  color: #ffffff;
  font-size: clamp(1.45rem, 2.1cqw, 2.45rem);
  line-height: 1;
  text-shadow: 0 0 14px rgba(103, 232, 249, 0.48);
}

.sorting-stat.primary strong {
  color: #bbf7d0;
}

.sorting-progress-stat strong {
  display: grid;
  gap: 5px;
  font-size: clamp(0.92rem, 1.08cqw, 1.22rem);
  line-height: 1.08;
}

.sorting-progress-stat i {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-style: normal;
}

.sorting-progress-stat b {
  font-size: clamp(1.18rem, 1.52cqw, 1.72rem);
}

.sorting-progress-stat em {
  color: #bae6fd;
  font-style: normal;
  opacity: 0.82;
}

.clean-track {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.42);
}

.clean-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #bef264);
  box-shadow: 0 0 14px rgba(132, 204, 22, 0.62);
  transition: width 320ms ease-out;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.category-pill {
  min-width: 0;
  border-radius: 8px;
  padding: 8px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.category-pill span,
.category-pill strong {
  display: block;
  white-space: nowrap;
}

.category-pill span {
  overflow: hidden;
  color: #e0f2fe;
  font-size: clamp(0.68rem, 0.78cqw, 0.92rem);
  font-weight: 800;
  text-overflow: ellipsis;
}

.category-pill strong {
  margin-top: 4px;
  font-size: clamp(1rem, 1.25cqw, 1.45rem);
}

.category-blue { box-shadow: inset 3px 0 0 #38bdf8; }
.category-green { box-shadow: inset 3px 0 0 #4ade80; }
.category-red { box-shadow: inset 3px 0 0 #fb7185; }
.category-gray { box-shadow: inset 3px 0 0 #cbd5e1; }

.mistake-board ol,
.group-board ol {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding-left: 18px;
  color: #ffffff;
  font-size: clamp(0.74rem, 0.88cqw, 1rem);
  font-weight: 700;
}

.mistake-board li,
.group-board li {
  min-width: 0;
  padding-right: 4px;
}

.mistake-board b,
.group-board b {
  color: #bef264;
  font-variant-numeric: tabular-nums;
}

.sorting-wait,
.sorting-intro,
.sorting-game {
  display: grid;
  gap: 18px;
}

.student-panel:has(.sorting-wait) {
  width: min(100%, 840px);
  border-color: rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(223, 249, 244, 0.9)),
    var(--surface);
  box-shadow:
    0 24px 70px rgba(12, 34, 28, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.student-panel:has(.sorting-wait) .student-header {
  background:
    linear-gradient(120deg, rgba(8, 145, 178, 0.16), rgba(34, 197, 94, 0.2)),
    rgba(255, 255, 255, 0.66);
}

.student-panel:has(.sorting-game),
.student-panel:has(.sorting-wait),
.student-panel:has(.sorting-intro) {
  width: min(100%, 1120px);
  border-color: rgba(255, 255, 255, 0.86);
  background:
    linear-gradient(180deg, rgba(186, 230, 253, 0.92) 0 47%, rgba(187, 247, 208, 0.96) 48% 100%);
  box-shadow:
    0 24px 70px rgba(12, 34, 28, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.student-panel:has(.sorting-game) .student-header,
.student-panel:has(.sorting-wait) .student-header,
.student-panel:has(.sorting-intro) .student-header {
  display: none;
}

.student-panel:has(.sorting-game) .student-app,
.student-panel:has(.sorting-wait) .student-app,
.student-panel:has(.sorting-intro) .student-app {
  padding: clamp(14px, 2.2vw, 24px);
}

.sorting-hero-card {
  position: relative;
  display: grid;
  gap: 18px;
  overflow: hidden;
  border-radius: 8px;
  padding: clamp(20px, 4vw, 34px);
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.95), rgba(224, 242, 254, 0.88)),
    #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(14, 165, 233, 0.16),
    inset 0 18px 32px rgba(255, 255, 255, 0.58);
}

.sorting-hero-card,
.sorting-intro {
  min-height: min(74dvh, 620px);
  align-content: center;
  background:
    linear-gradient(180deg, rgba(155, 219, 246, 0.72) 0 48%, rgba(139, 220, 90, 0.64) 49% 100%),
    radial-gradient(circle at 50% 90%, rgba(79, 184, 56, 0.26), transparent 44%),
    #e0f2fe;
}

.sorting-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(34, 197, 94, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.68), transparent 78%);
  pointer-events: none;
}

.sorting-standby-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: left;
}

.sorting-intro {
  text-align: center;
}

.sorting-orb {
  display: grid;
  flex: 0 0 auto;
  width: 92px;
  min-height: 76px;
  place-items: center;
  border: 1px solid rgba(14, 165, 233, 0.28);
  border-radius: 8px;
  color: #075985;
  font-weight: 900;
  letter-spacing: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(186, 230, 253, 0.74)),
    #ffffff;
  box-shadow:
    0 14px 24px rgba(14, 165, 233, 0.16),
    inset 0 -10px 18px rgba(34, 197, 94, 0.12);
}

.sorting-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 0 6px;
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 999px;
  padding: 4px 12px;
  color: #166534;
  background: rgba(220, 252, 231, 0.82);
  font-size: 0.84rem;
  font-weight: 900;
}

.sorting-hero-card h2 {
  margin-bottom: 0;
  color: #0f172a;
  font-size: clamp(1.45rem, 4.6vw, 2.35rem);
  line-height: 1.18;
}

.sorting-standby-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  margin: 0 auto;
  color: #294856;
  line-height: 1.7;
  text-align: center;
}

.sorting-rings {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 2px 0 0;
}

.sorting-rings span,
.rule-steps span {
  min-width: 0;
  border-radius: 8px;
  padding: 10px 8px;
  color: #0f172a;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.78);
}

.sorting-rings span {
  display: grid;
  gap: 5px;
  justify-items: center;
  min-height: 136px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 12px 10px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    #ffffff;
  box-shadow:
    0 12px 20px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.sorting-rings img {
  width: min(84px, 62%);
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(15, 23, 42, 0.18));
}

.sorting-rings strong {
  color: #0f172a;
  font-size: 1.02rem;
}

.sorting-rings small {
  color: #47606b;
  font-size: 0.8rem;
  font-weight: 800;
}

.sorting-rings .ring-blue { box-shadow: inset 0 4px 0 #38bdf8, 0 12px 20px rgba(14, 165, 233, 0.1); }
.sorting-rings .ring-green { box-shadow: inset 0 4px 0 #4ade80, 0 12px 20px rgba(34, 197, 94, 0.1); }
.sorting-rings .ring-red { box-shadow: inset 0 4px 0 #fb7185, 0 12px 20px rgba(244, 63, 94, 0.1); }
.sorting-rings .ring-gray { box-shadow: inset 0 4px 0 #94a3b8, 0 12px 20px rgba(100, 116, 139, 0.1); }

.sorting-wait-status {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(20, 184, 166, 0.26);
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  font-weight: 900;
}

.sorting-wait-status span {
  position: relative;
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.16);
}

.sorting-wait-status span::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #67e8f9);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.45);
  animation: standbySweep 1.8s ease-in-out infinite;
}

.sorting-wait-status strong {
  color: #0f172a;
  font-size: 0.95rem;
}

@keyframes standbySweep {
  0% {
    transform: translateX(-110%);
  }
  55%,
  100% {
    transform: translateX(240%);
  }
}

.rule-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.sorting-progress {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #0f766e;
  font-weight: 900;
}

.sorting-progress strong {
  color: #0f172a;
  font-size: 1.2rem;
}

.compound-scene {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(20, 184, 166, 0.28);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(240, 253, 250, 0.96), rgba(236, 253, 245, 0.78)),
    #ffffff;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.1);
}

.compound-scene > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.compound-scene > div span {
  color: #0f766e;
  font-size: 0.9rem;
  font-weight: 900;
}

.compound-scene > div strong {
  min-width: 0;
  color: #0f172a;
  font-size: 1.08rem;
}

.compound-scene ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compound-scene li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  padding: 8px;
  color: #334155;
  background: rgba(255, 255, 255, 0.74);
}

.compound-scene li span {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #0f766e;
  font-size: 0.8rem;
  font-weight: 900;
  background: #ccfbf1;
}

.compound-scene li b {
  min-width: 0;
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compound-scene li.is-active {
  border-color: rgba(34, 197, 94, 0.48);
  color: #14532d;
  background: #dcfce7;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.compound-scene li.is-done {
  color: #0f766e;
  background: rgba(204, 251, 241, 0.72);
}

.scene-hint:empty {
  display: none;
}

.play-area {
  --sorting-glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(238, 255, 248, 0.28));
  --sorting-glass-bg-soft: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(238, 255, 248, 0.2));
  --sorting-glass-border: rgba(255, 255, 255, 0.78);
  --sorting-glass-blur: blur(16px) saturate(160%);
  --sorting-glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  --sorting-glass-shadow: 0 18px 42px rgba(20, 70, 48, 0.14), var(--sorting-glass-inset);
  display: grid;
  gap: 12px;
}

.card-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 188px;
}

.card-stage .trash-card {
  width: min(260px, 82vw);
  min-height: 174px;
  border: 2px solid var(--sorting-glass-border);
  background: var(--sorting-glass-bg);
  box-shadow: var(--sorting-glass-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}

.card-tip {
  min-height: 24px;
  color: #64748b;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.bins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bins .sorting-bin,
.bins .sorting-bin[data-category] {
  grid-area: auto;
  min-height: 132px;
  border: 2px solid var(--sorting-glass-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), var(--sorting-bin-tint, rgba(220, 252, 231, 0.24))),
    var(--sorting-glass-bg-soft);
  box-shadow: var(--sorting-glass-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  overflow: hidden;
}

.sorting-arena {
  display: grid;
  grid-template-areas:
    "recyclable card kitchen"
    "hazardous card other";
  grid-template-columns: minmax(94px, 1fr) minmax(138px, 1.2fr) minmax(94px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.sorting-bin {
  position: relative;
  min-height: 118px;
  border: 2px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  padding: 12px 8px;
  color: #0f172a;
  cursor: pointer;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.sorting-bin img {
  display: block;
  width: min(70px, 48%);
  height: auto;
  margin: 0 auto 4px;
  filter: drop-shadow(0 8px 10px rgba(15, 23, 42, 0.14));
}

.bin-category-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 16px rgba(15, 23, 42, 0.12);
}

.bin-category-icon img {
  width: 18px;
  margin: 0;
  filter: none;
}

.sorting-bin[data-category="recyclable"] { grid-area: recyclable; }
.sorting-bin[data-category="kitchen"] { grid-area: kitchen; }
.sorting-bin[data-category="hazardous"] { grid-area: hazardous; }
.sorting-bin[data-category="other"] { grid-area: other; }

.sorting-bin:hover,
.sorting-bin:focus-visible,
.sorting-bin.is-drop-target {
  transform: translateY(-2px);
  outline: 3px solid rgba(14, 165, 233, 0.28);
}

.sorting-bin.is-drop-target {
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow:
    0 18px 36px rgba(22, 101, 52, 0.2),
    0 0 0 6px rgba(187, 247, 208, 0.72);
}

.bin-mascot {
  display: block;
  margin-bottom: 6px;
  font-size: 1.12rem;
  font-weight: 900;
}

.sorting-bin strong,
.sorting-bin small {
  display: block;
}

.sorting-bin small {
  margin-top: 4px;
  color: #475569;
  font-weight: 700;
}

.bin-blue { background: linear-gradient(180deg, #e0f2fe, #ffffff); border-color: #38bdf8; }
.bin-green { background: linear-gradient(180deg, #dcfce7, #ffffff); border-color: #4ade80; }
.bin-red { background: linear-gradient(180deg, #ffe4e6, #ffffff); border-color: #fb7185; }
.bin-gray { background: linear-gradient(180deg, #f1f5f9, #ffffff); border-color: #94a3b8; }

.bins .bin-blue {
  --sorting-bin-tint: rgba(219, 234, 254, 0.42);
  --sorting-bin-accent: #2563eb;
}

.bins .bin-green {
  --sorting-bin-tint: rgba(220, 252, 231, 0.46);
  --sorting-bin-accent: #16a34a;
}

.bins .bin-red {
  --sorting-bin-tint: rgba(254, 226, 226, 0.44);
  --sorting-bin-accent: #dc2626;
}

.bins .bin-gray {
  --sorting-bin-tint: rgba(241, 245, 249, 0.54);
  --sorting-bin-accent: #475569;
}

.bins .sorting-bin strong {
  color: var(--sorting-bin-accent, #14532d);
}

.bins .sorting-bin small {
  border: 1px solid color-mix(in srgb, var(--sorting-bin-accent, #14532d) 54%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--sorting-bin-accent, #14532d);
  background: rgba(255, 255, 255, 0.48);
}

.trash-card {
  grid-area: card;
  align-self: center;
  display: grid;
  min-height: 240px;
  place-items: center;
  gap: 8px;
  border: 2px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  padding: 18px;
  color: #0f172a;
  text-align: center;
  background:
    radial-gradient(circle at 50% 12%, rgba(187, 247, 208, 0.86), transparent 42%),
    #ffffff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
  will-change: transform;
}

.trash-card:active {
  cursor: grabbing;
}

.trash-card.is-dragging {
  z-index: 5;
  opacity: 0.94;
  cursor: grabbing;
  box-shadow:
    0 28px 54px rgba(15, 23, 42, 0.24),
    0 0 0 6px rgba(187, 247, 208, 0.52);
  transition: none;
}

.trash-visual {
  display: grid;
  width: min(150px, 76%);
  height: auto;
  place-items: center;
}

.trash-visual img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 20px rgba(15, 23, 42, 0.18));
}

.trash-emoji {
  display: block;
  font-size: clamp(54px, 15vw, 76px);
  line-height: 1;
  filter: drop-shadow(0 14px 18px rgba(15, 23, 42, 0.18));
  transform: translateY(-2px);
}

.sorting-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #14532d;
  font-size: 0.95rem;
}

.sorting-hint span,
.sorting-hint strong,
.sorting-prompt {
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(220, 252, 231, 0.82);
}

.sorting-prompt {
  min-height: 44px;
  color: #0f172a;
  font-weight: 800;
}

.sorting-game {
  gap: 16px;
}

.sorting-game .sorting-progress {
  position: relative;
  z-index: 5;
  width: min(100%, 360px);
  border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: 8px;
  padding: 10px 14px;
  background:
    linear-gradient(180deg, rgba(111, 171, 198, 0.82), rgba(66, 127, 155, 0.72));
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(15, 23, 42, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 10px 24px rgba(15, 118, 110, 0.16);
}

.sorting-game .sorting-progress span,
.sorting-game .sorting-progress strong {
  color: #ffffff;
}

.sorting-game .sorting-progress span {
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 10px;
  background: linear-gradient(180deg, #facc15, #f97316);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 2px 0 rgba(180, 83, 9, 0.48);
}

.sorting-arena {
  display: block;
}

.sorting-stage-frame {
  position: relative;
  min-height: clamp(560px, 72dvh, 720px);
  overflow: hidden;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(255, 255, 255, 0.92), transparent 16%),
    radial-gradient(ellipse at 82% 14%, rgba(255, 255, 255, 0.78), transparent 15%),
    radial-gradient(ellipse at 34% 22%, rgba(255, 255, 255, 0.52), transparent 12%),
    linear-gradient(180deg, #a8def5 0 54%, #84d86e 55% 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -70px 0 rgba(100, 190, 57, 0.34),
    0 24px 56px rgba(15, 23, 42, 0.14);
}

.sorting-stage-frame::before,
.sorting-stage-frame::after,
.sorting-board-glow {
  content: "";
  position: absolute;
  pointer-events: none;
}

.sorting-stage-frame::before {
  left: -6%;
  right: -6%;
  bottom: 20%;
  height: 22%;
  border: 0;
  border-radius: 50% 50% 0 0;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.35), transparent 55%),
    linear-gradient(180deg, rgba(157, 226, 86, 0.7), rgba(83, 181, 56, 0.86));
}

.sorting-stage-frame::after {
  left: 50%;
  top: 41%;
  width: min(26%, 190px);
  aspect-ratio: 1;
  border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.34);
  box-shadow:
    0 0 0 12px rgba(255, 255, 255, 0.2),
    0 0 42px rgba(14, 165, 233, 0.18);
}

.sorting-board-glow {
  inset: 10%;
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.35), transparent 35% 65%, rgba(255, 255, 255, 0.28));
  mix-blend-mode: screen;
}

.sorting-game-title {
  position: absolute;
  left: 50%;
  top: 5%;
  z-index: 3;
  transform: translateX(-50%) rotate(-1deg);
  color: #ffb72e;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  -webkit-text-stroke: 5px #ffffff;
  paint-order: stroke fill;
  text-shadow:
    0 6px 0 #f97316,
    0 12px 0 rgba(180, 83, 9, 0.24),
    0 18px 28px rgba(15, 23, 42, 0.2);
}

.sorting-drop-zones {
  position: absolute;
  left: clamp(14px, 2.4vw, 28px);
  right: clamp(14px, 2.4vw, 28px);
  bottom: clamp(16px, 3vw, 30px);
  top: auto;
  z-index: 2;
  display: grid;
  grid-template-areas:
    "recyclable kitchen hazardous other";
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(190px, 1fr);
  gap: clamp(8px, 1.6vw, 16px);
  pointer-events: none;
}

.sorting-drop-zones .sorting-bin {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 48px;
  height: 100%;
  padding: 8px;
  pointer-events: auto;
  border-width: 0;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(20, 83, 45, 0.24), transparent 58%);
  box-shadow: none;
}

.sorting-drop-zones .sorting-bin::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 4px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 83, 45, 0.18);
  pointer-events: none;
}

.sorting-bin .sorting-bin-image {
  width: min(154px, 96%);
  max-height: 154px;
  object-fit: contain;
  margin-bottom: 0;
  filter: drop-shadow(0 14px 14px rgba(15, 23, 42, 0.22));
}

.sorting-drop-zones .bin-category-icon {
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: none;
}

.sorting-drop-zones .bin-mascot {
  margin: -2px 0 2px;
  border-radius: 999px;
  padding: 2px 10px;
  color: #ffffff;
  font-size: 0.92rem;
  background: rgba(15, 23, 42, 0.56);
}

.sorting-drop-zones .sorting-bin strong {
  color: #ffffff;
  font-size: 1rem;
  text-shadow:
    0 2px 2px rgba(15, 23, 42, 0.48),
    0 0 8px rgba(15, 23, 42, 0.2);
}

.sorting-drop-zones .sorting-bin small {
  display: none;
  max-width: 9em;
  margin-top: 2px;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.25;
}

.sorting-drop-zones .sorting-bin:hover,
.sorting-drop-zones .sorting-bin:focus-visible,
.sorting-drop-zones .sorting-bin.is-drop-target {
  transform: translateY(-4px) scale(1.02);
}

.sorting-drop-zones .sorting-bin.is-drop-target {
  outline: 4px solid rgba(34, 197, 94, 0.24);
  box-shadow:
    0 22px 42px rgba(22, 101, 52, 0.24),
    0 0 0 8px rgba(187, 247, 208, 0.72);
}

.bin-blue { --bin-tint: #dbeafe; }
.bin-green { --bin-tint: #dcfce7; }
.bin-red { --bin-tint: #ffe4e6; }
.bin-gray { --bin-tint: #f1f5f9; }

.trash-card-shell {
  position: absolute;
  left: 50%;
  top: 36%;
  z-index: 4;
  display: grid;
  justify-items: center;
  width: clamp(188px, 26%, 270px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sorting-task-label {
  min-height: 28px;
  margin-bottom: 8px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 999px;
  padding: 4px 12px;
  color: #0f766e;
  background: rgba(255, 255, 255, 0.84);
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.1);
}

.trash-card-shell .trash-card {
  width: 100%;
  min-height: 0;
  aspect-ratio: 1 / 1.05;
  padding: clamp(14px, 2vw, 22px);
  pointer-events: auto;
  border-color: rgba(15, 118, 110, 0.28);
  background:
    radial-gradient(circle at 50% 9%, rgba(220, 252, 231, 0.95), transparent 44%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow:
    0 24px 44px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.trash-card-shell .trash-visual {
  width: min(150px, 76%);
}

.trash-card-shell .trash-card strong {
  font-size: clamp(1.1rem, 2.8vw, 1.45rem);
}

.trash-card-shell .trash-card small {
  color: #0f766e;
  font-weight: 900;
}

.sorting-hint {
  justify-content: center;
}

.sorting-prompt {
  border: 1px solid rgba(15, 118, 110, 0.18);
  background:
    linear-gradient(90deg, rgba(236, 253, 245, 0.94), rgba(240, 249, 255, 0.92));
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.08);
}

.sorting-result-card {
  border-color: rgba(34, 197, 94, 0.35);
}

.student-panel:has(.sorting-result) {
  width: min(1280px, calc(100vw - 32px), calc((100dvh - 32px) * 1.777778));
  aspect-ratio: 16 / 9;
  border-color: rgba(255, 255, 255, 0.86);
  background:
    linear-gradient(90deg, rgba(236, 253, 245, 0.9), rgba(240, 249, 255, 0.94)),
    var(--surface);
  box-shadow:
    0 26px 80px rgba(12, 34, 28, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.student-panel:has(.sorting-result) .student-header {
  display: none;
}

.student-panel:has(.sorting-result) .student-app {
  height: 100%;
  padding: clamp(18px, 2.4vw, 34px);
}

.sorting-result {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  grid-template-rows: auto auto 1fr auto;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  padding: clamp(18px, 3vw, 42px);
  text-align: center;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background:
    radial-gradient(circle at 22% 18%, rgba(34, 197, 94, 0.14), transparent 34%),
    radial-gradient(circle at 80% 78%, rgba(14, 165, 233, 0.12), transparent 34%),
    rgba(255, 255, 255, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 16px 42px rgba(22, 101, 52, 0.12);
}

.sorting-result .done {
  grid-column: 1 / -1;
  margin: 0;
  color: #16a34a;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  text-shadow: 2px 2px 0 #ffffff;
}

.score-ring {
  grid-row: 2 / 5;
  justify-self: center;
  position: relative;
  width: min(310px, 28vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring .track {
  stroke: #dcfce7;
}

.score-ring .meter {
  stroke: #f59e0b;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.score-ring .center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-ring .big {
  color: #16384a;
  font-size: clamp(3.5rem, 7vw, 5.2rem);
  font-weight: 900;
  line-height: 1;
}

.score-ring .small {
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 800;
}

.sorting-result .title-chip {
  justify-self: start;
  border-radius: 999px;
  padding: 10px 22px;
  color: #ffffff;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  box-shadow: 0 12px 22px rgba(22, 163, 74, 0.22);
  font-weight: 900;
}

.sorting-result .stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  gap: 12px;
  width: 100%;
}

.sorting-result .stat {
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 12px 24px rgba(22, 101, 52, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.sorting-result .sv {
  color: #16384a;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 900;
}

.sorting-result .sl {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
}

.mistakes {
  width: 100%;
  border: 1.5px solid rgba(255, 255, 255, 0.68);
  border-radius: 18px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow:
    0 14px 28px rgba(22, 101, 52, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.mistakes h3 {
  margin-bottom: 8px;
  color: #f59e0b;
  font-size: 1.12rem;
  font-weight: 900;
}

.mistakes .chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.mistakes .chips .chip {
  border: 2px solid #fcd34d;
  border-radius: 999px;
  padding: 6px 14px;
  color: #b45309;
  background: #fef3c7;
  font-size: 0.9rem;
  font-weight: 900;
}

.mistakes .allgood {
  color: #16a34a;
  font-weight: 900;
}

.sorting-result .encourage {
  grid-column: 2;
  width: 100%;
  margin: 0;
  color: #14532d;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 800;
  line-height: 1.55;
}

@media (min-width: 760px) {
  .bins {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .card-stage {
    min-height: 210px;
  }
}

@media (max-width: 720px) {
  .student-panel:has(.sorting-wait) .student-header {
    padding-top: 22px;
    padding-bottom: 14px;
  }

  .student-panel:has(.sorting-wait) .student-app {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .sorting-hero-card {
    gap: 12px;
    padding: 16px;
  }

  .sorting-standby-head {
    align-items: stretch;
    text-align: center;
    flex-direction: column;
    gap: 12px;
  }

  .sorting-orb {
    width: 100%;
    min-height: 48px;
  }

  .sorting-status-chip {
    margin-bottom: 4px;
  }

  .sorting-standby-copy {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .sorting-rings,
  .rule-steps {
    grid-template-columns: 1fr 1fr;
  }

  .sorting-rings {
    gap: 10px;
  }

  .sorting-rings span {
    min-height: 118px;
    padding: 9px 8px;
  }

  .sorting-rings img {
    width: min(68px, 58%);
    height: 54px;
  }

  .sorting-wait-status {
    gap: 6px;
    padding: 10px;
  }

  .sorting-arena {
    grid-template-areas:
      "card card"
      "recyclable kitchen"
      "hazardous other";
    grid-template-columns: 1fr 1fr;
  }

  .trash-card {
    min-height: 170px;
  }

  .trash-card-shell {
    width: clamp(132px, 34%, 176px);
    top: 37%;
  }

  .trash-card-shell .trash-card {
    min-height: 132px;
  }

  .trash-card-shell .trash-visual {
    width: min(104px, 74%);
  }
}

.student-panel:has(.sorting-game),
.student-panel:has(.sorting-wait),
.student-panel:has(.sorting-intro) {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.92), transparent 23%),
    radial-gradient(circle at 86% 16%, rgba(255, 236, 200, 0.72), transparent 22%),
    linear-gradient(135deg, #dff7ff 0%, #f7f0ff 48%, #e8ffe7 100%);
  box-shadow:
    0 28px 72px rgba(46, 72, 93, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.student-panel:has(.sorting-game) .student-app {
  padding: clamp(12px, 2.4vw, 24px);
}

.sorting-game {
  width: min(100%, 1040px);
  margin: 0 auto;
  gap: 14px;
}

.sorting-game .sorting-progress {
  width: min(100%, 520px);
  margin: 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(232, 246, 255, 0.88)),
    #ffffff;
  color: #21566f;
  text-shadow: none;
  box-shadow:
    0 10px 22px rgba(62, 119, 148, 0.14),
    inset 0 0 0 1px rgba(89, 172, 211, 0.16);
}

.sorting-game .sorting-progress span,
.sorting-game .sorting-progress strong {
  color: #18455c;
}

.sorting-game .sorting-progress span {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 4px 12px;
  background: linear-gradient(145deg, #ffd166, #ff9f5a);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 4px 10px rgba(232, 132, 47, 0.24);
}

.sorting-game .sorting-progress strong {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sorting-stage-frame {
  min-height: clamp(560px, 72dvh, 700px);
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.42)),
    radial-gradient(ellipse at 50% 44%, rgba(255, 255, 255, 0.82) 0 18%, transparent 19%),
    linear-gradient(180deg, #afe4ff 0 55%, #92dc7b 56% 100%);
  box-shadow:
    0 22px 46px rgba(71, 101, 121, 0.18),
    inset 0 0 0 4px rgba(255, 255, 255, 0.8),
    inset 0 0 0 6px rgba(91, 179, 217, 0.16),
    inset 0 -74px 0 rgba(83, 177, 64, 0.24);
}

.sorting-stage-frame::before {
  left: 3%;
  right: 3%;
  bottom: 22%;
  height: 20%;
  border-radius: 999px 999px 0 0;
  background:
    radial-gradient(ellipse at 50% 0, rgba(255, 255, 255, 0.46), transparent 62%),
    linear-gradient(180deg, rgba(181, 238, 119, 0.78), rgba(94, 188, 73, 0.86));
  box-shadow: inset 0 18px 28px rgba(255, 255, 255, 0.22);
}

.sorting-stage-frame::after {
  top: 42%;
  width: min(280px, 42%);
  border: 3px dashed rgba(47, 139, 96, 0.26);
  background: rgba(255, 255, 255, 0.44);
  box-shadow:
    0 0 0 12px rgba(255, 255, 255, 0.16),
    0 14px 34px rgba(65, 126, 94, 0.12);
}

.sorting-board-glow {
  inset: 16px;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 20% 14%, rgba(255, 255, 255, 0.84), transparent 15%),
    radial-gradient(ellipse at 76% 18%, rgba(255, 255, 255, 0.64), transparent 14%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.28), transparent 36% 66%, rgba(255, 255, 255, 0.22));
}

.sorting-game-title {
  top: 5.4%;
  color: #ffad4d;
  font-size: clamp(2.35rem, 7vw, 5.4rem);
  -webkit-text-stroke: 4px #ffffff;
  text-shadow:
    0 4px 0 #ff7a59,
    0 10px 0 rgba(255, 125, 65, 0.18),
    0 18px 28px rgba(83, 94, 112, 0.18);
  animation: sortingTitleFloat 2.6s ease-in-out infinite;
}

.sorting-drop-zones {
  left: clamp(12px, 2.5vw, 28px);
  right: clamp(12px, 2.5vw, 28px);
  bottom: clamp(14px, 2.8vw, 28px);
  grid-template-rows: minmax(188px, 1fr);
  gap: clamp(9px, 1.6vw, 16px);
}

.sorting-drop-zones .sorting-bin {
  min-height: 174px;
  border: 3px dashed rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  padding: 10px 8px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.22)),
    radial-gradient(ellipse at 50% 100%, rgba(26, 90, 45, 0.26), transparent 60%);
  box-shadow:
    inset 0 0 0 1px rgba(73, 116, 75, 0.1),
    0 10px 22px rgba(54, 99, 57, 0.1);
}

.sorting-drop-zones .sorting-bin::before {
  left: 10%;
  right: 10%;
  bottom: 8px;
  height: 24px;
  background: rgba(25, 76, 42, 0.18);
  filter: blur(1px);
}

.sorting-bin .sorting-bin-image {
  width: min(154px, 92%);
  max-height: 154px;
  transform-origin: 50% 100%;
  transition:
    transform 220ms ease,
    filter 220ms ease;
  filter: drop-shadow(0 16px 16px rgba(42, 60, 75, 0.24));
}

.sorting-drop-zones .sorting-bin strong {
  margin-top: 2px;
  border-radius: 999px;
  padding: 3px 12px;
  background: rgba(17, 41, 54, 0.52);
  color: #ffffff;
  font-size: clamp(0.88rem, 1.7vw, 1rem);
}

.sorting-drop-zones .bin-mascot {
  display: none;
}

.sorting-drop-zones .sorting-bin:hover,
.sorting-drop-zones .sorting-bin:focus-visible,
.sorting-drop-zones .sorting-bin.is-drop-target {
  border-color: rgba(255, 208, 102, 0.96);
  transform: translateY(-8px) scale(1.035);
  outline: 0;
  box-shadow:
    0 22px 38px rgba(57, 101, 66, 0.22),
    0 0 0 6px rgba(255, 255, 255, 0.34);
}

.sorting-drop-zones .sorting-bin:hover .sorting-bin-image,
.sorting-drop-zones .sorting-bin:focus-visible .sorting-bin-image,
.sorting-drop-zones .sorting-bin.is-drop-target .sorting-bin-image {
  transform: scale(1.08) rotate(-2deg);
  filter:
    drop-shadow(0 18px 16px rgba(42, 60, 75, 0.26))
    drop-shadow(0 0 14px rgba(255, 209, 102, 0.46));
}

.sorting-drop-zones .sorting-bin.is-drop-target {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 247, 219, 0.46)),
    radial-gradient(ellipse at 50% 100%, rgba(76, 146, 54, 0.32), transparent 62%);
}

.sorting-card-container {
  perspective: 1000px;
}

.trash-card-shell {
  top: 39%;
  width: clamp(192px, 26%, 276px);
}

.sorting-task-label {
  min-height: 30px;
  margin-bottom: 10px;
  border: 0;
  color: #2b6174;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 8px 18px rgba(46, 94, 110, 0.14),
    inset 0 0 0 1px rgba(66, 148, 174, 0.14);
}

.trash-card-shell .trash-card {
  aspect-ratio: 1 / 1.02;
  border: 3px solid rgba(107, 196, 160, 0.34);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 245, 196, 0.92), transparent 38%),
    linear-gradient(145deg, #ffffff, #f4fbff);
  box-shadow:
    0 20px 34px rgba(63, 96, 117, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
  transform-style: preserve-3d;
}

.trash-card-shell .trash-card:hover {
  transform: translateY(-6px) rotateX(2deg) rotateZ(-1deg);
  box-shadow:
    0 26px 42px rgba(63, 96, 117, 0.23),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.trash-card-shell .trash-card.is-dragging {
  opacity: 0.96;
  transform: scale(1.04) rotate(3deg);
  box-shadow:
    0 30px 58px rgba(63, 96, 117, 0.3),
    0 0 0 7px rgba(255, 221, 122, 0.5);
}

.trash-card-shell .trash-visual {
  width: min(142px, 74%);
}

.trash-card-shell .trash-card strong {
  color: #16384a;
  font-size: clamp(1.12rem, 2.6vw, 1.42rem);
}

.trash-card-shell .trash-card small {
  border-radius: 999px;
  padding: 4px 10px;
  color: #ffffff;
  background: linear-gradient(145deg, #ff8fb3, #ff6b8f);
  font-size: 0.82rem;
  box-shadow: 0 7px 16px rgba(255, 107, 143, 0.2);
}

.sorting-hint {
  justify-content: center;
  gap: 8px;
  color: #2d5d46;
  font-size: clamp(0.82rem, 1.5vw, 0.94rem);
}

.sorting-hint span,
.sorting-hint strong {
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(78, 151, 102, 0.1);
}

.sorting-prompt {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  color: #26586f;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 251, 255, 0.9));
  box-shadow:
    0 10px 24px rgba(67, 108, 126, 0.12),
    inset 0 0 0 1px rgba(87, 166, 196, 0.14);
}

.sorting-prompt.is-empty {
  opacity: 0.62;
}

.sorting-prompt.is-success {
  color: #ffffff;
  background: linear-gradient(145deg, #92e68c, #31c86c);
  box-shadow: 0 12px 28px rgba(49, 200, 108, 0.28);
}

.sorting-prompt.is-retry {
  color: #ffffff;
  background: linear-gradient(145deg, #ffb0c3, #ff6b9a);
  box-shadow: 0 12px 28px rgba(255, 107, 154, 0.24);
}

.sorting-prompt.is-answer {
  color: #ffffff;
  background: linear-gradient(145deg, #ffc46c, #ff8b57);
  box-shadow: 0 12px 28px rgba(255, 139, 87, 0.24);
}

@keyframes sortingTitleFloat {
  0%,
  100% {
    transform: translateX(-50%) rotate(-1deg) translateY(0);
  }

  50% {
    transform: translateX(-50%) rotate(1deg) translateY(-5px);
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-8px);
  }

  60% {
    transform: translateY(-4px);
  }
}

.bounce {
  animation: bounce 0.6s ease;
}

.sorting-reference-start {
  min-height: min(74dvh, 640px);
  align-content: center;
  justify-items: center;
  gap: 16px;
  text-align: center;
  background:
    radial-gradient(circle at 15% 12%, rgba(187, 247, 208, 0.76), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(167, 243, 208, 0.66), transparent 26%),
    linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(209, 250, 229, 0.9));
}

.sorting-title-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 18px;
  color: #ffffff;
  background: #16a34a;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.22);
}

.sorting-reference-start h2 {
  margin: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(1px, 0.2vw, 3px);
  color: #087443;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "YouYuan", "幼圆", sans-serif;
  font-size: clamp(2.55rem, 8vw, 4.6rem);
  font-weight: 1000;
  line-height: 1.06;
  letter-spacing: 0;
  filter: drop-shadow(0 8px 10px rgba(15, 118, 110, 0.12));
}

.sorting-reference-start h2 span {
  display: inline-block;
  color: #087443;
  font-weight: 1000;
  transform-origin: center bottom;
  transform: translateY(calc((var(--title-index) % 2) * 3px));
  -webkit-font-smoothing: antialiased;
  text-shadow:
    0 2px 0 #ffffff,
    0 5px 0 #86efac,
    0 8px 10px rgba(8, 116, 67, 0.16);
  transition: transform 180ms ease;
}

.sorting-reference-start h2:hover span {
  transform: translateY(calc((var(--title-index) % 2) * 2px - 2px));
}

.sorting-category-intro-grid {
  display: grid;
  width: min(100%, 760px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.sorting-category-intro-item {
  display: grid;
  grid-template-rows: 128px auto;
  align-items: end;
  justify-items: stretch;
  gap: 10px;
  min-width: 0;
}

.sorting-intro-mascot {
  width: clamp(76px, 11vw, 110px);
  max-height: 124px;
  align-self: end;
  justify-self: center;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(20, 40, 30, 0.18));
  animation: sortingMascotBob 2.6s ease-in-out infinite;
}

.sorting-category-intro-item:nth-child(2) .sorting-intro-mascot { animation-delay: 0.25s; }
.sorting-category-intro-item:nth-child(3) .sorting-intro-mascot { animation-delay: 0.5s; }
.sorting-category-intro-item:nth-child(4) .sorting-intro-mascot { animation-delay: 0.75s; }

@keyframes sortingMascotBob {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.sorting-rule-grid {
  display: grid;
  width: min(100%, 760px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sorting-category-intro-grid .sorting-rule-card {
  width: 100%;
  height: 100%;
}

.sorting-category-intro-grid .sorting-rule-card strong {
  max-width: 100%;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
}

@media (max-width: 620px) {
  .sorting-category-intro-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sorting-rule-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 12px 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.28));
  box-shadow:
    0 8px 22px rgba(20, 40, 30, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px) saturate(170%);
}

.sorting-rule-card .bin-category-icon {
  position: static;
}

.sorting-start-challenge {
  width: auto;
  min-width: 180px;
  border-radius: 999px;
  padding-inline: 34px;
  background: #ea580c;
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.24);
}

.sorting-gamebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 760px);
  margin: 0 auto;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.36));
  box-shadow:
    0 8px 22px rgba(20, 40, 30, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px) saturate(170%);
}

.sorting-game > .sorting-progress:not(.sorting-gamebar) {
  display: none;
}

.sorting-gamebar .qinfo {
  display: grid;
  min-width: 0;
  text-align: left;
}

.sorting-gamebar .qinfo strong {
  overflow: hidden;
  color: #14361f;
  font-size: 1.12rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sorting-gamebar .qinfo small,
.progress-text {
  color: #64748b;
  font-weight: 800;
}

.progress-wrap {
  flex: 1 1 240px;
  min-width: 160px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.78rem;
}

.progress-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  transition: width 350ms cubic-bezier(0.16, 0.84, 0.44, 1);
}

.trash-card.selected {
  border-color: #ea580c;
  box-shadow:
    0 0 0 6px rgba(234, 88, 12, 0.2),
    0 24px 44px rgba(15, 23, 42, 0.18);
  transform: scale(1.04);
}

.sorting-drop-zones .sorting-bin.correct-flash,
.bins .sorting-bin.correct-flash {
  animation: sortingBinPop 350ms cubic-bezier(0.16, 0.84, 0.44, 1);
}

.sorting-drop-zones .sorting-bin.wrong-flash,
.bins .sorting-bin.wrong-flash {
  animation: sortingBinShake 350ms cubic-bezier(0.16, 0.84, 0.44, 1);
}

@keyframes sortingBinPop {
  0% { transform: scale(1); }
  42% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes sortingBinShake {
  0%,
  100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.sorting-feedback-toast {
  --feedback-accent: #22c55e;
  --feedback-accent-bright: #4ade80;
  --feedback-soft: rgba(220, 252, 231, 0.96);
  --feedback-ring: rgba(74, 222, 128, 0.25);
  position: fixed;
  left: 50%;
  top: calc(18px + env(safe-area-inset-top));
  z-index: 80;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(620px, calc(100vw - 32px));
  min-height: 88px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 14px 16px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 1), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), var(--feedback-soft)),
    var(--feedback-soft);
  box-shadow:
    0 18px 42px color-mix(in srgb, var(--feedback-accent) 18%, rgba(15, 23, 42, 0.12)),
    0 0 0 5px var(--feedback-ring),
    inset 0 1px 0 #ffffff,
    inset 0 -12px 24px color-mix(in srgb, var(--feedback-accent-bright) 10%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
  backdrop-filter: blur(20px) saturate(155%);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-18px) scale(0.97);
  transition:
    transform 220ms cubic-bezier(0.16, 0.84, 0.44, 1),
    opacity 160ms ease;
}

.sorting-feedback-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.sorting-feedback-toast.is-ok {
  --feedback-accent: #16a34a;
  --feedback-accent-bright: #4ade80;
  --feedback-soft: rgba(220, 252, 231, 0.98);
  --feedback-ring: rgba(74, 222, 128, 0.28);
}
.sorting-feedback-toast.is-retry {
  --feedback-accent: #f97316;
  --feedback-accent-bright: #facc15;
  --feedback-soft: rgba(255, 247, 196, 0.98);
  --feedback-ring: rgba(250, 204, 21, 0.3);
}
.sorting-feedback-toast.is-miss {
  --feedback-accent: #f43f5e;
  --feedback-accent-bright: #fb7185;
  --feedback-soft: rgba(255, 228, 230, 0.98);
  --feedback-ring: rgba(251, 113, 133, 0.27);
}

.sorting-feedback-toast .fb-head {
  color: color-mix(in srgb, var(--feedback-accent) 62%, #153227);
  font-size: 1.08rem;
  line-height: 1.35;
}

.sorting-feedback-toast .fbic {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, var(--feedback-accent-bright), var(--feedback-accent));
  box-shadow:
    0 8px 18px color-mix(in srgb, var(--feedback-accent) 34%, transparent),
    inset 0 2px 0 rgba(255, 255, 255, 0.48);
  font-size: 1.25rem;
  font-weight: 900;
}

.sorting-feedback-toast .fb-copy {
  min-width: 0;
}

.sorting-feedback-toast .fb-body {
  margin-top: 4px;
  color: #3f5f50;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.45;
}

.sorting-feedback-toast.auto .btn-next {
  display: none;
}

.btn-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  min-height: 46px;
  border-radius: 999px;
  padding: 10px 20px;
  color: #ffffff;
  border: 1px solid color-mix(in srgb, var(--feedback-accent) 76%, black);
  background: linear-gradient(135deg, var(--feedback-accent-bright), var(--feedback-accent));
  box-shadow:
    0 8px 18px color-mix(in srgb, var(--feedback-accent) 32%, transparent),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.btn-next:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-next:active {
  transform: translateY(1px) scale(0.98);
}

.btn-next:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--feedback-accent) 28%, transparent);
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .sorting-feedback-toast {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    top: calc(10px + env(safe-area-inset-top));
    min-height: 0;
    padding: 12px;
    border-radius: 16px;
  }

  .sorting-feedback-toast .fbic {
    width: 40px;
    height: 40px;
  }

  .sorting-feedback-toast .btn-next {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.float-score {
  position: fixed;
  z-index: 9998;
  color: #15803d;
  font-size: 1.75rem;
  font-weight: 900;
  pointer-events: none;
  text-shadow: 1px 1px 0 #ffffff;
  animation: floatUp 1s cubic-bezier(0.16, 0.84, 0.44, 1) forwards;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.6);
  }

  20% { opacity: 1; }

  100% {
    opacity: 0;
    transform: translate(-50%, -70px) scale(1.1);
  }
}

.is-dashboard.is-sorting-active .assembly-layer,
.is-dashboard.is-sorting-finished .assembly-layer,
.is-dashboard.is-sorting-active .dashboard-bin-characters,
.is-dashboard.is-sorting-finished .dashboard-bin-characters {
  display: none !important;
}

.is-dashboard.is-sorting-active .sorting-dashboard,
.is-dashboard.is-sorting-finished .sorting-dashboard {
  z-index: 12;
}

@media (max-width: 720px) {
  .sorting-game {
    gap: 10px;
  }

  .sorting-game .sorting-progress {
    align-items: center;
    width: 100%;
    padding: 7px 10px;
  }

  .sorting-game .sorting-progress strong {
    font-size: 0.94rem;
  }

  .sorting-stage-frame {
    min-height: clamp(520px, 75dvh, 620px);
  }

  .sorting-game-title {
    top: 5.8%;
    font-size: clamp(2rem, 12vw, 3.2rem);
    -webkit-text-stroke-width: 3px;
  }

  .trash-card-shell {
    top: 38%;
    width: clamp(136px, 38%, 176px);
  }

  .sorting-task-label {
    min-height: 26px;
    margin-bottom: 6px;
    padding: 3px 10px;
    font-size: 0.75rem;
  }

  .trash-card-shell .trash-card {
    min-height: 132px;
    padding: 12px 10px;
  }

  .trash-card-shell .trash-visual {
    width: min(100px, 72%);
  }

  .trash-card-shell .trash-card small {
    display: none;
  }

  .sorting-drop-zones {
    grid-template-areas:
      "recyclable kitchen"
      "hazardous other";
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(116px, 1fr));
  }

  .sorting-drop-zones .sorting-bin {
    min-height: 114px;
    padding: 6px;
  }

  .sorting-bin .sorting-bin-image {
    width: min(106px, 84%);
    max-height: 92px;
  }

  .sorting-drop-zones .sorting-bin strong {
    padding: 2px 9px;
    font-size: 0.82rem;
  }

  .sorting-hint {
    display: none;
  }

  .sorting-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sorting-gamebar {
    align-items: stretch;
    flex-direction: column;
  }
}

.shield-energy {
  --energy-glow: rgba(132, 255, 100, 0.72);
  --energy-rim: rgba(168, 255, 126, 0.72);
  --energy-core: rgba(190, 242, 100, 0.92);
  top: 6.1%;
  left: 9.2%;
  bottom: auto;
  width: 33.8%;
  height: 4.6%;
}

.monster-energy {
  --energy-glow: rgba(236, 72, 153, 0.72);
  --energy-rim: rgba(251, 113, 133, 0.72);
  --energy-core: rgba(192, 132, 252, 0.88);
  top: 6.1%;
  left: 64.2%;
  right: auto;
  bottom: auto;
  width: 30.6%;
  height: 4.6%;
}

.energy-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.shield-energy.energy-panel {
  padding-left: 0;
}

.monster-energy.energy-panel {
  padding-right: 0;
}

.energy-label {
  display: none;
}

.energy-label strong {
  color: #ffffff;
}

.energy-track {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--energy-rim);
  background:
    radial-gradient(ellipse at 50% 10%, rgba(255, 255, 255, 0.32), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(8, 20, 28, 0.16) 36%, rgba(0, 0, 0, 0.42) 100%),
    rgba(3, 10, 14, 0.2);
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.34),
    inset 0 -5px 10px rgba(0, 0, 0, 0.56),
    inset 0 0 18px rgba(0, 0, 0, 0.46),
    0 0 16px var(--energy-glow),
    0 5px 10px rgba(0, 0, 0, 0.28);
}

.energy-track::before,
.energy-track::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
}

.energy-track::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.1) 23%, transparent 48%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 11%, transparent 88%, rgba(255, 255, 255, 0.16));
  mix-blend-mode: screen;
}

.energy-track::after {
  inset: 2px;
  background:
    radial-gradient(ellipse at center bottom, rgba(0, 0, 0, 0.42), transparent 48%),
    linear-gradient(180deg, transparent 0 52%, rgba(0, 0, 0, 0.36));
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.36),
    inset 0 -2px 4px rgba(0, 0, 0, 0.52);
}

.energy-fill {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  transition: width 420ms ease-out;
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.34),
    inset 0 -6px 10px rgba(0, 0, 0, 0.24),
    0 0 16px var(--energy-glow);
}

.energy-fill::before,
.energy-fill::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.energy-fill::before {
  left: 4%;
  right: 4%;
  top: 11%;
  height: 32%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.08));
  opacity: 0.66;
  filter: blur(0.2px);
}

.energy-fill::after {
  top: 0;
  right: -10px;
  bottom: 0;
  width: 22px;
  background: radial-gradient(circle at right center, rgba(255, 255, 255, 0.92), var(--energy-core) 28%, transparent 67%);
  filter: blur(1px);
  opacity: 0.72;
}

.shield-fill {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 34%, rgba(42, 83, 18, 0.22) 100%),
    linear-gradient(90deg, #22c55e, #5eead4 48%, #bef264);
}

.monster-fill {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 33%, rgba(76, 29, 149, 0.28) 100%),
    linear-gradient(90deg, #fb923c, #ef4444 48%, #a855f7);
}

.roster-panel {
  left: 3.1%;
  bottom: 19%;
  width: 26%;
  max-height: 25%;
  padding: 12px;
}

.roster-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  overflow: hidden;
}

.student-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  max-width: 172px;
  border-radius: 8px;
  padding: 5px 10px 5px 6px;
  background: rgba(236, 253, 245, 0.18);
  color: #ffffff;
  font-size: 0.78rem;
}

.student-chip b {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.78);
  font-size: 0.76rem;
  overflow: hidden;
}

.word-panel {
  top: auto;
  left: 22%;
  right: 22%;
  bottom: 5.5%;
  height: 15%;
  min-height: 0;
  display: grid;
  align-items: stretch;
  padding: 16px 24px 14px;
  border: 1px solid rgba(168, 245, 255, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(9, 32, 45, 0.62), rgba(6, 18, 28, 0.34)),
    radial-gradient(circle at 50% 0%, rgba(132, 255, 100, 0.2), transparent 54%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 28px rgba(103, 232, 249, 0.1),
    0 0 28px rgba(5, 150, 105, 0.18);
  backdrop-filter: blur(3px);
}

.word-panel.dashboard-layer {
  transform: none;
}

.is-assembly .word-panel.dashboard-layer {
  transform: translateY(12px);
}

.word-panel > div {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  transform: translateY(-0.3cqw);
}

.word-panel .panel-title {
  width: 100%;
  color: #72f266;
  font-size: clamp(1.75rem, 2.15cqw, 2.55rem);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0;
  text-shadow:
    0 0 10px rgba(57, 255, 91, 0.5),
    0 0 18px rgba(34, 197, 94, 0.24);
}

.word-cloud {
  --word-cloud-size: clamp(1.45rem, 1.85cqw, 2.15rem);
  --word-cloud-gap-x: clamp(18px, 2.6cqw, 44px);
  --word-cloud-gap-y: clamp(5px, 0.7cqw, 10px);
  display: flex;
  align-items: center;
  align-content: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--word-cloud-gap-y) var(--word-cloud-gap-x);
  height: 100%;
  min-height: 24px;
  margin-top: 6px;
  overflow: hidden;
}

.word-cloud span {
  max-width: 100%;
  color: #ffffff;
  font-size: var(--word-cloud-size);
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
  text-shadow: 0 0 12px rgba(103, 232, 249, 0.28);
}

.word-cloud .weight-1 {
  font-size: var(--word-cloud-size);
}

.word-cloud .weight-2 {
  font-size: var(--word-cloud-size);
  color: #ffffff;
}

.word-cloud .weight-3 {
  font-size: var(--word-cloud-size);
  color: #ffffff;
}

.word-cloud .weight-4,
.word-cloud .weight-5 {
  font-size: var(--word-cloud-size);
  color: #ffffff;
}

.teacher-actions {
  display: grid;
  gap: 8px;
  width: 116px;
}

.hud-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(165, 243, 252, 0.3);
  background: linear-gradient(135deg, #22d3ee, #6366f1 56%, #d946ef);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow:
    0 0 18px rgba(34, 211, 238, 0.34),
    0 0 28px rgba(217, 70, 239, 0.16);
}

.hud-button.primary-glow {
  background: linear-gradient(135deg, #22d3ee, #6366f1 54%, #d946ef);
}

.hud-button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.62);
  box-shadow: none;
}

.pulse {
  animation: pulse 520ms ease-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 30;
  max-width: min(92vw, 520px);
  transform: translateX(-50%) translateY(80px);
  border-radius: 8px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  opacity: 0;
  transition: 180ms ease-out;
  pointer-events: none;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 720px) {
  .student-shell {
    padding: 0;
    place-items: stretch;
  }

  .student-panel {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .student-panel:has(.sorting-wait) {
    width: 100%;
  }

  .student-header,
  .student-app {
    padding-left: 18px;
    padding-right: 18px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .avatar-grid,
  .commit-grid,
  .score-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .teacher-page {
    align-items: start;
    overflow-x: auto;
  }

  .teacher-stage {
    min-width: 980px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assembly-student,
  .pulse,
  .sorting-wait-status span::after {
    animation: none;
  }

  .assembly-lightfall,
  .dashboard-particles,
  .dashboard-layer,
  .assembly-layer {
    transition: none;
  }
}

/* Reference one-to-one sorting game layout */
body:has(.sorting-game),
body:has(.sorting-intro),
body:has(.sorting-wait) {
  background:
    radial-gradient(1100px 600px at 12% -8%, #bbf7d0 0%, transparent 55%),
    radial-gradient(1000px 560px at 112% 4%, #a7f3d0 0%, transparent 52%),
    radial-gradient(900px 700px at 50% 120%, #86efac 0%, transparent 60%),
    linear-gradient(180deg, #dcfce7 0%, #ecfdf5 45%, #d1fae5 100%);
}

.student-shell:has(.sorting-game),
.student-shell:has(.sorting-intro),
.student-shell:has(.sorting-wait) {
  background:
    radial-gradient(1100px 600px at 12% -8%, #bbf7d0 0%, transparent 55%),
    radial-gradient(1000px 560px at 112% 4%, #a7f3d0 0%, transparent 52%),
    radial-gradient(900px 700px at 50% 120%, #86efac 0%, transparent 60%),
    linear-gradient(180deg, #dcfce7 0%, #ecfdf5 45%, #d1fae5 100%);
}

.student-panel:has(.sorting-game) {
  position: relative;
  isolation: isolate;
  width: min(100%, 1100px);
  border: 0;
  background:
    radial-gradient(1100px 600px at 12% -8%, #bbf7d0 0%, transparent 55%),
    radial-gradient(1000px 560px at 112% 4%, #a7f3d0 0%, transparent 52%),
    radial-gradient(900px 700px at 50% 120%, #86efac 0%, transparent 60%),
    linear-gradient(180deg, #dcfce7 0%, #ecfdf5 45%, #d1fae5 100%);
  box-shadow: none;
}

.student-panel:has(.sorting-game)::before,
.student-panel:has(.sorting-game)::after,
.student-panel:has(.sorting-game) .student-app::before,
.student-panel:has(.sorting-game) .student-app::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.student-panel:has(.sorting-game)::before,
.student-panel:has(.sorting-game)::after,
.student-panel:has(.sorting-game) .student-app::before {
  z-index: 0;
  border-radius: 30%;
  filter: blur(2px);
  opacity: 0.3;
}

.student-panel:has(.sorting-game)::before {
  top: 8.5%;
  left: 8%;
  width: clamp(88px, 12vw, 136px);
  height: clamp(88px, 12vw, 136px);
  background: #4ade80;
  transform: rotate(12deg);
}

.student-panel:has(.sorting-game)::after {
  right: 7%;
  top: 17%;
  width: clamp(72px, 10vw, 118px);
  height: clamp(72px, 10vw, 118px);
  background: #86efac;
  transform: rotate(20deg);
}

.student-panel:has(.sorting-game) .student-app {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-height: calc(100dvh - 32px);
  padding: max(16px, env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
}

.student-panel:has(.sorting-game) .student-app::before {
  left: 13%;
  bottom: 10%;
  width: clamp(68px, 8vw, 96px);
  height: clamp(68px, 8vw, 96px);
  background: #34d399;
  transform: rotate(-8deg);
}

.student-panel:has(.sorting-game) .student-app::after {
  right: -4%;
  bottom: -6%;
  z-index: 0;
  width: clamp(138px, 20vw, 240px);
  height: clamp(190px, 26vw, 320px);
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 14px 32px rgba(20, 40, 30, 0.12);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
}

.sorting-game {
  --c-primary: #16a34a;
  --c-secondary: #4ade80;
  --c-accent: #ea580c;
  --c-fg: #14361f;
  --c-success: #15803d;
  --c-warn: #b45309;
  --c-warn-soft: #fef3c7;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow-sm: 0 2px 6px rgba(20, 40, 30, 0.1);
  --shadow-md: 0 8px 22px rgba(20, 40, 30, 0.16);
  --shadow-lg: 0 18px 44px rgba(20, 40, 30, 0.24);
  --ring: 0 0 0 4px rgba(34, 197, 94, 0.35);
  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.22));
  --glass-bg-soft: linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.14));
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: blur(16px) saturate(170%);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  --t-fast: 150ms;
  --t-mid: 250ms;
  --t-slow: 350ms;
  --ease-out: cubic-bezier(0.16, 0.84, 0.44, 1);
  display: flex;
  position: relative;
  z-index: 1;
  flex-direction: column;
  min-height: calc(100dvh - 32px);
  gap: 0;
  color: var(--c-fg);
}

.sorting-game .trash-card.entering-bin {
  transition:
    transform 220ms cubic-bezier(0.16, 0.84, 0.44, 1),
    opacity 180ms ease;
  will-change: transform, opacity;
}

.sorting-game .gamebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0 0 14px;
  border: 1.5px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  background: var(--glass-bg);
  box-shadow: var(--shadow-sm), var(--glass-inset);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  flex-wrap: wrap;
}

.sorting-game .gamebar .qinfo {
  display: flex;
  min-width: 0;
  flex-direction: column;
  text-align: left;
}

.sorting-game .gamebar .qtitle {
  overflow: hidden;
  color: var(--c-fg);
  font-size: 18px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sorting-game .gamebar .qtype {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.sorting-game .progress-wrap {
  flex: 1 1 160px;
  min-width: 140px;
}

.sorting-game .progress-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.sorting-game .progress-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.sorting-game .progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
  transition: width var(--t-slow) var(--ease-out);
}

.sorting-game > .sorting-progress,
.sorting-game .sorting-hint,
.sorting-game .sorting-prompt {
  display: none;
}

.sorting-game .scene-hint {
  min-height: 20px;
  margin-bottom: 8px;
  color: var(--c-accent);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.sorting-game .play-area {
  position: relative;
  display: flex;
  flex-direction: column;
  z-index: 2;
  margin-top: auto;
  padding-bottom: 6px;
  gap: 0;
  overflow: visible;
}

.sorting-game .card-stage {
  position: relative;
  display: flex;
  z-index: 30;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(168px, 25dvh, 218px);
  margin-bottom: 8px;
  gap: 8px;
  overflow: visible;
  border: 1.5px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--r-lg);
  padding: 14px 12px 12px;
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.58), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 10px 24px rgba(20, 70, 48, 0.08);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
}

.sorting-game .card-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: min(260px, 62%);
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  filter: blur(8px);
  opacity: 0.7;
  transform: translateX(-50%);
}

.sorting-game .card-stage > * {
  position: relative;
  z-index: 1;
}

.sorting-game .trash-card-grid {
  display: grid;
  width: min(100%, 680px);
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  align-items: center;
  justify-items: center;
  gap: 12px;
}

.sorting-game .trash-card,
.sorting-game .card-stage .trash-card {
  position: relative;
  display: flex;
  width: min(100%, 190px);
  min-height: 0;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 14px;
  color: var(--c-fg);
  background: var(--glass-bg);
  box-shadow: var(--shadow-md), var(--glass-inset);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition:
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast),
    opacity var(--t-mid);
}

.sorting-game .trash-card:active {
  cursor: grabbing;
}

.sorting-game .trash-card.selected {
  border-color: var(--c-accent);
  box-shadow: var(--ring), var(--shadow-md);
  transform: scale(1.04);
}

.sorting-game .trash-card.dragging,
.sorting-game .trash-card.is-dragging {
  z-index: 90;
  opacity: 0.94;
  cursor: grabbing;
  box-shadow:
    0 28px 54px rgba(15, 23, 42, 0.24),
    0 0 0 6px rgba(187, 247, 208, 0.52);
}

.sorting-game .trash-visual {
  display: block;
  width: auto;
}

.sorting-game .trash-visual img {
  width: clamp(54px, 15vw, 76px);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.sorting-game .trash-emoji {
  display: block;
  font-size: clamp(54px, 15vw, 76px);
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.sorting-game .trash-card strong {
  width: 100%;
  max-width: 100%;
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
}

.text-fit.text-fit-sm {
  font-size: clamp(15px, 3.8vw, 19px) !important;
  line-height: 1.25;
}

.text-fit.text-fit-xs {
  font-size: clamp(13px, 3.2vw, 16px) !important;
  line-height: 1.3;
}

.sorting-game .card-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  padding: 4px 14px;
  color: #496477;
  background: rgba(255, 255, 255, 0.64);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 5px 12px rgba(20, 70, 48, 0.08);
}

.sorting-game .bins {
  position: relative;
  display: grid;
  z-index: 1;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 6px;
}

.sorting-game .bin,
.sorting-game .bins .bin[data-category] {
  --bc: #999999;
  --bcs: #eeeeee;
  position: relative;
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  border: 2px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 10px 8px 12px;
  background: var(--glass-bg-soft);
  box-shadow: var(--shadow-sm), var(--glass-inset);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  cursor: pointer;
  transition:
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast),
    background var(--t-fast);
}

.sorting-game .bin::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--bcs);
  opacity: 0.3;
}

.sorting-game .bin > * {
  position: relative;
  z-index: 1;
}

.sorting-game .bin:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--glass-inset);
}

.sorting-game .bin:focus-visible {
  outline: none;
  box-shadow: var(--ring), var(--shadow-sm);
}

.sorting-game .bin.over {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 0 0 4px var(--bc), var(--shadow-md);
}

.sorting-game .bin img {
  width: clamp(60px, 17vw, 96px);
  height: auto;
  margin: 0;
  pointer-events: none;
  filter: none;
}

.sorting-game .bin .bname {
  width: 100%;
  max-width: 100%;
  color: var(--bc);
  font-size: clamp(14px, 3.6vw, 18px);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
}

.sorting-game .bin .brule {
  border: 1.5px solid var(--bc);
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--bc);
  background: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  font-weight: 700;
}

.sorting-game .bin-blue {
  --bc: #2563eb;
  --bcs: #dbeafe;
}

.sorting-game .bin-green {
  --bc: #16a34a;
  --bcs: #dcfce7;
}

.sorting-game .bin-red {
  --bc: #dc2626;
  --bcs: #fee2e2;
}

.sorting-game .bin-gray {
  --bc: #4b5563;
  --bcs: #e5e7eb;
}

.sorting-game .bin.correct-flash {
  animation: pop var(--t-slow) var(--ease-out);
}

.sorting-game .bin.wrong-flash {
  animation: shake var(--t-slow) var(--ease-out);
}

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%,
  100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

@media (min-width: 760px) {
  .sorting-game .bins {
    grid-template-columns: repeat(4, 1fr);
  }

  .sorting-game .card-stage {
    min-height: 210px;
  }
}

@media (min-width: 721px) {
  .student-panel:has(.sorting-game) {
    width: min(1100px, calc(100vw - 32px), calc((100dvh - 32px) * 1.6));
    aspect-ratio: 16 / 10;
    overflow: hidden;
  }

  .student-panel:has(.sorting-game) .student-app,
  .sorting-game {
    height: 100%;
    min-height: 0;
  }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .student-panel:has(.sorting-game) {
    width: min(1024px, calc(100vw - 32px), calc((100dvh - 32px) * 1.333333));
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 380px) {
  .sorting-game .bin {
    min-height: 132px;
  }

  .sorting-game .bin img {
    width: 54px;
  }
}

/* Teacher sorting dashboard: bright Green Valley data screen */
.is-dashboard.is-sorting-active .sorting-dashboard,
.is-dashboard.is-sorting-finished .sorting-dashboard {
  --ref-panel: rgba(255, 255, 255, 0.94);
  --ref-border: rgba(34, 197, 94, 0.2);
  --ref-ink: #12301f;
  --ref-copy: #22384a;
  --ref-blue: #0f4fb3;
  --ref-green: #0f7a3b;
  --ref-orange: #a84c00;
  --ref-red: #a11212;
  --ref-slate: #273445;
  position: relative;
  inset: auto;
  z-index: 120;
  width: 100%;
  height: auto;
  min-height: 100dvh;
  display: block;
  padding: 0;
  overflow: visible;
  color: var(--ref-ink);
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% -18%, rgba(250, 204, 21, 0.22), transparent 38%),
    linear-gradient(180deg, #ecfdf5 0%, #f7fee7 45%, #ffffff 100%);
  box-shadow: none;
  backdrop-filter: none;
  font-family: Inter, "Microsoft YaHei", sans-serif;
}

.is-dashboard.is-sorting-active .dashboard-particles,
.is-dashboard.is-sorting-finished .dashboard-particles,
.is-dashboard.is-sorting-active .dashboard-bg,
.is-dashboard.is-sorting-finished .dashboard-bg {
  display: none;
}

.teacher-stage.is-sorting-active::before,
.teacher-stage.is-sorting-active::after,
.teacher-stage.is-sorting-finished::before,
.teacher-stage.is-sorting-finished::after {
  content: none;
}

.sorting-reference-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(34, 197, 94, 0.18);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
}

.sorting-reference-brand,
.sorting-reference-actions,
.sorting-live-pill,
.sorting-action-button,
.sorting-section-heading,
.mistake-board-heading,
.mistake-board-heading h2,
.mistake-board-heading small {
  display: flex;
  align-items: center;
}

.sorting-reference-brand { min-width: 0; gap: 14px; }
.sorting-reference-logo { color: var(--ref-green); font-size: 30px; text-shadow: 0 0 15px rgba(15, 122, 59, 0.18); }
.sorting-reference-brand h1 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ref-ink);
  font: 800 clamp(18px, 1.5vw, 24px)/1.2 "Plus Jakarta Sans", "Microsoft YaHei", sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sorting-reference-actions {
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  min-width: 0;
}
.sorting-live-pill { gap: 9px; padding: 7px 15px; color: #0c5f2d; border: 1px solid rgba(15, 122, 59, 0.34); border-radius: 999px; background: rgba(209, 250, 229, 0.9); }
.sorting-live-pill i,
.mistake-board-heading small i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sorting-live-pill i { animation: dashboardPulse 1.8s ease-in-out infinite; }

.sorting-action-button {
  flex: 0 0 auto;
  gap: 7px;
  min-height: 44px;
  padding: 0 10px;
  color: #0c5f2d;
  font: 700 14px/1 Inter, "Microsoft YaHei", sans-serif;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}
.sorting-action-button:hover { color: var(--ref-ink); background: rgba(209, 250, 229, 0.88); }
.sorting-action-danger { color: var(--ref-red); }
.sorting-action-danger:hover { color: #7f1111; background: rgba(254, 226, 226, 0.9); }

.sorting-reference-content { width: min(1600px, calc(100% - 64px)); margin: 0 auto; padding: 32px 0 54px; }
.sorting-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.sorting-overview-card,
.category-pill,
.mistake-board { border: 1px solid var(--ref-border); background: var(--ref-panel); backdrop-filter: blur(20px); box-shadow: 0 14px 34px rgba(22, 101, 52, 0.08); }

.sorting-overview-card {
  min-height: 152px;
  padding: 24px;
  text-align: center;
  border-radius: 12px;
  transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
  animation: dashboardRise 650ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sorting-overview-card:hover,
.category-pill:hover { transform: translateY(-5px); }
.sorting-overview-card span,
.sorting-overview-card small { display: block; color: var(--ref-copy); }
.sorting-overview-card span { margin-bottom: 8px; font-size: 14px; }
.sorting-overview-card strong { display: block; color: var(--ref-blue); font: 800 clamp(36px, 4vw, 52px)/1.1 "Plus Jakarta Sans", "Microsoft YaHei", sans-serif; }
.sorting-overview-card small { margin-top: 8px; font-size: 12px; }
.overview-secondary strong { color: var(--ref-green); }
.overview-yellow strong { color: var(--ref-orange); }
.overview-green strong { color: var(--ref-green); }
.sorting-overview-card .clean-track { height: 8px; margin-top: 14px; background: rgba(250, 204, 21, 0.2); }
.sorting-overview-card .clean-track i { background: linear-gradient(90deg, #facc15, #84cc16); box-shadow: 0 0 14px rgba(132, 204, 22, 0.25); }

.sorting-category-section { margin-top: 38px; }
.sorting-section-heading { justify-content: center; gap: 12px; margin-bottom: 24px; }
.sorting-section-heading h2,
.mistake-board-heading h2 { margin: 0; font: 800 24px/1.2 "Plus Jakarta Sans", "Microsoft YaHei", sans-serif; }
.sorting-section-heading h2,
.mistake-board-heading h2 { color: var(--ref-ink); }
.sorting-section-heading i { color: var(--ref-green); font-style: normal; }
.is-dashboard.is-sorting-active .category-grid,
.is-dashboard.is-sorting-finished .category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }

.category-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 216px;
  padding: 22px 18px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: none;
  animation: dashboardRise 650ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}
.category-pill.category-blue:hover { border-color: rgba(0, 122, 255, 0.55); box-shadow: 0 12px 30px rgba(0, 122, 255, 0.14); }
.category-pill.category-green:hover { border-color: rgba(52, 199, 89, 0.55); box-shadow: 0 12px 30px rgba(52, 199, 89, 0.14); }
.category-pill.category-red:hover { border-color: rgba(255, 59, 48, 0.55); box-shadow: 0 12px 30px rgba(255, 59, 48, 0.14); }
.category-pill.category-gray:hover { border-color: rgba(100, 116, 139, 0.35); box-shadow: 0 12px 30px rgba(100, 116, 139, 0.1); }
.category-visual {
  display: grid;
  width: 45%;
  min-width: 150px;
  justify-items: center;
  align-content: center;
  gap: 10px;
}
.category-visual img { width: 82%; max-height: 150px; object-fit: contain; filter: drop-shadow(0 14px 12px rgba(22, 101, 52, 0.18)); animation: dashboardFloat 4s ease-in-out infinite; }
.category-visual h3 { margin: 0; color: var(--ref-blue); font-size: 22px; font-weight: 900; line-height: 1.15; text-align: center; }
.category-pill > .category-index {
  position: absolute;
  top: 14px;
  right: 14px;
  min-width: 34px;
  padding: 5px 9px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  border-radius: 999px;
  background: #0f7a3b;
  box-shadow: 0 8px 18px rgba(15, 122, 59, 0.26);
}
.category-card-copy { min-width: 0; flex: 1; }
.category-card-copy small,
.category-card-copy strong,
.category-card-copy p,
.category-card-copy em { display: block; }
.category-metrics { display: grid; gap: 12px; align-content: center; }
.category-stat {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(236, 253, 245, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 22px rgba(22, 101, 52, 0.07);
}
.category-stat small { margin-bottom: 6px; color: var(--ref-copy); font-size: 13px; font-weight: 800; }
.category-stat strong { color: var(--ref-blue); font: 900 clamp(30px, 3vw, 42px)/1 "Plus Jakarta Sans", "Microsoft YaHei", sans-serif; }
.category-stat-completed { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.category-stat-completed small { margin: 0; }
.category-pill .category-stat-completed strong { color: #0c5f2d; font-size: clamp(24px, 2.4vw, 32px); }
.category-stat strong i { margin-left: 3px; color: var(--ref-copy); font-size: 0.46em; font-style: normal; font-weight: 900; }
.category-green .category-visual h3,
.category-green .category-stat-accuracy strong { color: var(--ref-green); }
.category-red .category-visual h3,
.category-red .category-stat-accuracy strong { color: var(--ref-red); }
.category-gray .category-visual h3,
.category-gray .category-stat-accuracy strong { color: var(--ref-slate); }
.category-performance { width: max-content; padding: 5px 10px; color: #0c5f2d; font-size: 11px; font-style: normal; font-weight: 800; border: 1px solid rgba(15, 122, 59, 0.3); border-radius: 999px; background: rgba(236, 253, 245, 0.96); }
.category-performance.star { color: #0f7a3b; border-color: rgba(15, 122, 59, 0.34); background: rgba(209, 250, 229, 0.92); }
.category-performance.warning { color: var(--ref-red); border-color: rgba(161, 18, 18, 0.28); background: rgba(254, 226, 226, 0.9); }

.is-dashboard.is-sorting-active .mistake-board,
.is-dashboard.is-sorting-finished .mistake-board { display: block; margin-top: 38px; padding: 28px 32px; border-radius: 12px; }
.mistake-board-heading { justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.mistake-board-heading h2 { gap: 10px; }
.mistake-board-heading h2 span { color: var(--ref-orange); }
.mistake-board-heading small { gap: 8px; padding: 7px 14px; color: #0c5f2d; border-radius: 999px; background: #e7f9ef; }
.mistake-table-head,
.mistake-table li { display: grid; grid-template-columns: 70px 1fr 1fr 1fr 2fr; gap: 22px; align-items: center; }
.mistake-table-head {
  padding: 12px 16px;
  color: #12301f;
  font-size: 14px;
  font-weight: 900;
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
  background: rgba(236, 253, 245, 0.94);
}

.mistake-table-head span {
  color: inherit;
  font-size: inherit;
}
.mistake-board ol { display: block; margin: 0; padding: 0; list-style: none; }
.mistake-table li {
  min-height: 68px;
  padding: 12px 16px;
  color: var(--ref-ink);
  font-size: 14px;
  font-weight: 800;
  border-bottom: 1px solid rgba(34, 197, 94, 0.14);
  background: rgba(255, 255, 255, 0.66);
  transition: transform 200ms ease, background 200ms ease;
}
.mistake-table li:last-child { border-bottom: 0; }
.mistake-table li:hover { transform: translateX(5px); background: rgba(240, 253, 244, 0.78); }
.mistake-table .mistake-rank {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  border-radius: 50%;
  background: #0f7a3b;
  box-shadow: 0 8px 18px rgba(15, 122, 59, 0.22);
}
.mistake-table .mistake-category { width: max-content; padding: 5px 11px; font-size: 13px; font-weight: 900; border: 1px solid rgba(22, 101, 52, 0.18); border-radius: 999px; background: rgba(255, 255, 255, 0.75); }
.mistake-category.category-blue { color: var(--ref-blue); background: rgba(219, 234, 254, 0.9); }
.mistake-category.category-green { color: var(--ref-green); background: rgba(220, 252, 231, 0.92); }
.mistake-category.category-red { color: var(--ref-red); background: rgba(254, 226, 226, 0.9); }
.mistake-table li em { color: var(--ref-red); font-size: 14px; font-style: normal; font-weight: 900; }
.mistake-table li small { color: #1f3a4a; font-size: 13px; font-weight: 800; line-height: 1.35; }
.mistake-table .mistake-empty { display: block; padding: 30px 16px; text-align: center; color: var(--ref-copy); font-weight: 800; }

@keyframes dashboardRise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dashboardFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes dashboardPulse { 50% { opacity: 0.35; transform: scale(0.75); } }

@media (max-width: 1180px) {
  .sorting-reference-content { width: min(100% - 36px, 1000px); }
  .sorting-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .is-dashboard.is-sorting-active .category-grid,
  .is-dashboard.is-sorting-finished .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .sorting-reference-header { align-items: flex-start; gap: 12px; padding: 16px; }
  .sorting-reference-actions { gap: 5px; }
  .sorting-live-pill { display: none; }
  .sorting-reference-content { width: calc(100% - 24px); padding-top: 18px; }
  .sorting-overview,
  .is-dashboard.is-sorting-active .category-grid,
  .is-dashboard.is-sorting-finished .category-grid { grid-template-columns: 1fr; }
  .mistake-table { overflow-x: auto; }
  .mistake-table-head,
  .mistake-table li { min-width: 760px; }
}

@media (prefers-reduced-motion: reduce) {
  .sorting-overview-card,
  .category-pill,
  .category-pill > img,
  .sorting-live-pill i { animation: none; }
}

.sorting-feedback-toast.auto.show {
  pointer-events: none;
  transition:
    transform 180ms cubic-bezier(0.16, 0.84, 0.44, 1),
    opacity 150ms ease;
}

.student-shell:has(.green-promise-page) {
  min-height: 100dvh;
  padding: clamp(16px, 3vw, 32px);
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(240, 252, 243, 0.08)),
    url("/assets/promise-wall-bg.png") center / cover no-repeat;
}

.student-shell:has(.green-promise-page)::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(240, 252, 243, 0.08)),
    url("/assets/promise-wall-bg.png") center / cover no-repeat;
  filter: blur(7px) saturate(112%);
  transform: scale(1.025);
}

.student-panel:has(.green-promise-page) {
  width: min(100%, 812px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.student-panel:has(.green-promise-success-page) {
  width: min(100%, 760px);
}

.student-panel:has(.green-promise-page) .student-header {
  display: none;
}

.student-panel:has(.green-promise-page) .student-app {
  padding: 0;
}

.green-promise-page {
  position: relative;
  min-height: min(84dvh, 860px);
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.green-promise-success-page {
  width: min(100%, 760px);
}

.green-promise-card {
  width: min(100%, 812px);
  display: grid;
  justify-items: center;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 48px;
  padding: clamp(42px, 5vw, 64px) clamp(32px, 4.4vw, 56px) clamp(42px, 4.7vw, 54px);
  background:
    linear-gradient(180deg, rgba(248, 255, 249, 0.82), rgba(240, 252, 243, 0.72)),
    rgba(248, 255, 249, 0.72);
  box-shadow:
    0 26px 68px rgba(0, 33, 13, 0.18),
    0 0 0 1px rgba(139, 216, 155, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px) saturate(145%);
}

.green-promise-avatar {
  display: grid;
  width: 128px;
  height: 128px;
  place-items: center;
  border: 5px solid rgba(118, 219, 149, 0.68);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.42), transparent 34%),
    rgba(22, 134, 74, 0.46);
  box-shadow:
    0 0 0 8px rgba(139, 216, 155, 0.18),
    0 12px 36px rgba(22, 134, 74, 0.24);
  overflow: hidden;
}

.green-promise-avatar img {
  width: 96%;
  height: 96%;
  object-fit: cover;
  transform: translateY(2px);
}

.green-promise-card h2 {
  margin: 14px 0 -4px;
  color: #25493c;
  font-size: clamp(2rem, 3.2vw, 2.5rem);
  font-weight: 850;
  line-height: 1.16;
  text-align: center;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.78),
    0 5px 14px rgba(0, 33, 13, 0.18);
}

.green-promise-copy {
  max-width: 480px;
  margin: 0 0 24px;
  color: #314b42;
  font-size: clamp(1.05rem, 1.55vw, 1.25rem);
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}

.green-promise-form {
  width: 100%;
  display: grid;
  gap: 30px;
}

.green-promise-form label {
  display: grid;
  gap: 16px;
  width: 100%;
  color: #233a2e;
  font-size: 1.125rem;
  font-weight: 900;
}

.promise-input-wrap {
  position: relative;
  display: grid;
}

.promise-input-icon {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 1;
  color: rgba(62, 73, 64, 0.48);
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-14deg);
  pointer-events: none;
}

.green-promise-form textarea {
  width: 100%;
  height: 73px;
  min-height: 73px;
  resize: none;
  border: 1.5px solid rgba(110, 122, 111, 0.22);
  border-radius: 999px;
  padding: 17px 30px 14px 62px;
  color: #131e19;
  background: rgba(248, 255, 249, 0.82);
  font-size: 1.25rem;
  line-height: 1.4;
  outline: none;
  box-shadow:
    inset 0 2px 9px rgba(19, 30, 25, 0.08),
    0 6px 20px rgba(19, 30, 25, 0.05);
}

.green-promise-form textarea::placeholder {
  color: #2f3a34;
  opacity: 0.88;
}

.green-promise-form textarea:focus {
  border-color: #76db95;
  box-shadow:
    0 0 0 4px rgba(139, 216, 155, 0.24),
    inset 0 2px 9px rgba(19, 30, 25, 0.08),
    0 10px 24px rgba(22, 134, 74, 0.1);
}

.promise-helper-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: rgba(62, 73, 64, 0.66);
}

.promise-helper-row small {
  color: inherit;
  font-weight: 650;
}

.green-promise-submit {
  min-height: 72px;
  gap: 18px;
  border: 1px solid rgba(0, 82, 42, 0.48);
  border-radius: 999px;
  color: #ffffff;
  background:
    linear-gradient(180deg, #18bd78 0%, #00905a 100%);
  box-shadow:
    0 18px 34px rgba(0, 107, 56, 0.24),
    inset 0 2px 0 rgba(255, 255, 255, 0.26),
    inset 0 -3px 0 rgba(0, 82, 42, 0.36);
  font-size: 1.25rem;
  letter-spacing: 0;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.green-promise-submit:hover {
  transform: translateY(-2px);
  box-shadow:
    0 22px 38px rgba(0, 107, 56, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    inset 0 -3px 0 rgba(0, 82, 42, 0.36);
}

.green-promise-submit:active {
  transform: translateY(1px);
}

.promise-submit-arrow {
  font-size: 1.8rem;
  line-height: 1;
}

.promise-success-card {
  z-index: 1;
  width: min(100%, 720px);
  gap: 16px;
  border-color: rgba(78, 204, 126, 0.62);
  border-radius: 8px;
  padding: clamp(26px, 4vw, 38px);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 255, 250, 0.9)),
    rgba(255, 255, 255, 0.94);
  box-shadow:
    0 28px 72px rgba(0, 33, 13, 0.2),
    0 8px 22px rgba(17, 94, 89, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  animation: promiseSuccessBeat 520ms ease-out both;
}

.promise-success-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(139, 216, 155, 0.48);
  border-radius: 8px;
  pointer-events: none;
}

.promise-success-card .eyebrow {
  margin: 0 0 -4px;
  color: #04724d;
  letter-spacing: 0;
}

.promise-success-card h2 {
  max-width: 640px;
  margin: 0;
  color: #006b38;
  font-size: clamp(1.9rem, 4vw, 2.2rem);
  line-height: 1.14;
  text-wrap: balance;
}

.promise-success-card .subtitle {
  max-width: 520px;
  margin: 0;
  color: #3c5663;
  font-weight: 700;
  line-height: 1.7;
}

.promise-success-stamp {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(236, 253, 245, 0.98), rgba(219, 245, 255, 0.86)),
    #ecfdf5;
  box-shadow:
    0 16px 30px rgba(22, 134, 74, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: promiseSuccessFloat 3.8s ease-in-out infinite;
}

.promise-success-stamp img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.promise-success-line {
  position: relative;
  width: min(100%, 560px);
  margin: 2px 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(53, 180, 105, 0.62);
  border-radius: 8px;
  padding: 12px 16px;
  color: #2f3a34;
  background:
    linear-gradient(90deg, rgba(236, 253, 245, 0.96), rgba(240, 249, 255, 0.95)),
    rgba(248, 255, 249, 0.94);
  font-size: 1.08rem;
  font-weight: 850;
  overflow-wrap: anywhere;
  box-shadow:
    0 14px 30px rgba(22, 134, 74, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.promise-success-name {
  min-width: 0;
  border-radius: 7px;
  padding: 8px 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #087f5b, #16a34a);
  white-space: nowrap;
}

.promise-success-shine {
  min-width: 0;
  color: #17352a;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@keyframes promiseSuccessBeat {
  0% {
    transform: scale(0.97);
  }
  55% {
    transform: scale(1.018);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes promiseSuccessFloat {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -8px;
  }
}

@media (max-width: 620px) {
  .student-shell:has(.green-promise-page) {
    padding: 14px;
  }

  .green-promise-page {
    min-height: calc(100dvh - 28px);
  }

  .green-promise-card {
    border-radius: 26px;
    gap: 18px;
  }

  .green-promise-avatar {
    width: 84px;
    height: 84px;
  }

  .green-promise-card h2 {
    font-size: 2.12rem;
  }

  .green-promise-form textarea {
    height: 58px;
    min-height: 58px;
    padding: 14px 22px 12px 54px;
  }

  .promise-success-card {
    gap: 16px;
    padding: 28px 20px;
  }

  .promise-success-card h2 {
    font-size: 2rem;
  }

  .promise-success-line {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .promise-success-name {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .promise-success-stamp,
  .promise-success-card {
    animation: none;
  }
}

.is-promise-active .dashboard-bg,
.is-promise-active .sorting-start-panel,
.is-promise-active .sorting-dashboard,
.is-promise-active .temporary-sorting-shortcut,
.is-promise-active .center-hud,
.is-promise-active .shield-energy,
.is-promise-active .monster-energy,
.is-promise-active .word-panel,
.is-promise-active .roster-panel {
  display: none !important;
}

.promise-wall {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  color: #131e19;
  background: #e3f2fd;
}

.promise-wall-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 45%),
    url("/assets/promise-wall-bg.png") center / cover no-repeat;
}

.promise-wall-header,
.promise-wall-footer,
.promise-complete-message {
  position: absolute;
  z-index: 3;
  border: 1px solid rgba(139, 216, 155, 0.58);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 30px rgba(22, 134, 74, 0.12);
  backdrop-filter: blur(14px);
}

.promise-wall-header {
  top: 0;
  left: 0;
  right: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 0 0 8px 8px;
  padding: 12px 24px;
}

.promise-wall-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.promise-wall-title span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #16864a;
  font-size: 1.35rem;
}

.promise-wall-title h1 {
  margin: 0;
  color: #006b38;
  font-size: 1.75rem;
  line-height: 1.2;
}

.promise-counter {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(139, 216, 155, 0.75);
  border-radius: 999px;
  padding: 0 20px;
  color: #1e6c3a;
  background: rgba(234, 247, 238, 0.94);
  font-size: 1rem;
  font-weight: 900;
  transition: transform 180ms ease;
}

.promise-counter::before {
  content: "";
  display: block;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #16864a 0 35%, transparent 37%),
    rgba(139, 216, 155, 0.36);
  box-shadow: 0 0 0 4px rgba(139, 216, 155, 0.18);
  animation: promiseCounterBreath 2s ease-in-out infinite;
}

.promise-counter.pulse {
  transform: scale(1.05);
}

.promise-wall-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.promise-reset-button {
  min-height: 42px;
  border: 1px solid rgba(185, 28, 28, 0.45);
  border-radius: 999px;
  padding: 0 18px;
  color: #ffffff;
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    0 8px 18px rgba(185, 28, 28, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.promise-reset-button:hover,
.promise-reset-button:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    0 12px 24px rgba(185, 28, 28, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.promise-reset-button:active {
  transform: translateY(1px);
}

.promise-danmaku {
  position: absolute;
  inset: 15% 0 12%;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.promise-bullet {
  --lane: 0;
  --duration: 10s;
  --travel-x: calc(-100vw - 120%);
  position: absolute;
  top: calc(10% + var(--lane) * 16%);
  left: 100%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: min(70%, 920px);
  white-space: nowrap;
  border: 1px solid #8bd89b;
  border-radius: 999px;
  padding: 13px 24px;
  color: #2f3a34;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 22px rgba(22, 134, 74, 0.14);
  backdrop-filter: blur(12px);
  animation: promiseDanmaku var(--duration) linear forwards;
  will-change: transform, opacity;
}

.promise-bullet.is-measuring {
  left: 0;
  top: 0;
  max-width: min(70%, 920px);
  opacity: 0;
  visibility: hidden;
  animation: none;
  transform: none;
}

.promise-bullet-name {
  color: #16864a;
  font-size: 1.25rem;
  font-weight: 900;
}

.promise-bullet-separator {
  color: rgba(30, 108, 58, 0.42);
  font-weight: 900;
}

.promise-bullet-text {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #2f3a34;
  font-size: 1.25rem;
  font-weight: 750;
}

.promise-wall-mascot {
  position: absolute;
  right: 5%;
  bottom: 10%;
  z-index: 3;
  width: clamp(88px, 10vw, 128px);
  aspect-ratio: 1;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 14px 32px rgba(22, 134, 74, 0.2);
  animation: promiseMascotPulse 2.4s ease-in-out infinite;
}

.promise-wall-footer {
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  min-width: 0;
  border-radius: 8px 8px 0 0;
  padding: 16px 24px;
  color: #1e6c3a;
  text-align: center;
  font-size: 1.18rem;
  font-weight: 900;
  animation: promiseFooterBreath 3s ease-in-out infinite;
}

.promise-complete-message {
  left: 50%;
  top: 46%;
  display: grid;
  gap: 8px;
  transform: translate(-50%, -50%);
  border-radius: 8px;
  padding: 24px 36px;
  text-align: center;
}

.promise-complete-message strong {
  color: #006b38;
  font-size: 2rem;
}

.promise-complete-message span {
  color: #3e4940;
  font-weight: 800;
}

@keyframes promiseDanmaku {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
  8%,
  88% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--travel-x), 0, 0);
  }
}

@keyframes promiseCounterBreath {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.72;
    transform: scale(1.06);
  }
}

@keyframes promiseMascotPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes promiseFooterBreath {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

@media (max-width: 760px) {
  .promise-wall-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .promise-danmaku {
    inset: 22% 0 14%;
  }

  .promise-wall-mascot {
    display: none;
  }
}

/* Keep the three active sorting cards visible instead of stacking in grid-area: card. */
.sorting-game .trash-card-grid {
  grid-template-columns: repeat(3, minmax(138px, 1fr));
}

.sorting-game .trash-card-grid .trash-card {
  grid-area: auto;
}

/* Polished Green Valley waiting scene for the student sorting gate. */
.sorting-wait .sorting-hero-card {
  min-height: min(78dvh, 680px);
  align-content: start;
  gap: clamp(18px, 2.5vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 8px;
  padding: clamp(26px, 4vw, 46px) clamp(22px, 4.4vw, 52px);
  background:
    linear-gradient(180deg, rgba(231, 248, 255, 0.72), rgba(255, 255, 255, 0.1) 45%, rgba(222, 255, 226, 0.82) 100%),
    url("/assets/green-valley-bg.png") center / cover no-repeat,
    #ddf7ff;
  box-shadow:
    0 26px 70px rgba(18, 82, 54, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.sorting-wait .sorting-hero-card::before {
  opacity: 0.42;
  mix-blend-mode: soft-light;
}

.sorting-wait .sorting-hero-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  z-index: 0;
  background: linear-gradient(180deg, rgba(186, 230, 253, 0), rgba(187, 247, 208, 0.9) 54%, rgba(134, 239, 172, 0.86));
  pointer-events: none;
}

.sorting-wait .sorting-standby-head {
  width: min(100%, 650px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: start;
  margin: clamp(16px, 4vw, 34px) auto 0;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  padding: clamp(16px, 2.4vw, 24px);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 18px 44px rgba(15, 76, 82, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  text-align: left;
}

.sorting-wait .sorting-orb {
  width: clamp(82px, 10vw, 108px);
  min-height: 88px;
  border-color: rgba(255, 255, 255, 0.88);
  color: #005d9f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(228, 246, 255, 0.82)),
    rgba(255, 255, 255, 0.8);
  box-shadow:
    0 14px 28px rgba(2, 132, 199, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  font-size: clamp(0.95rem, 2vw, 1.14rem);
}

.sorting-wait .sorting-status-chip {
  width: max-content;
  margin-bottom: 8px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  color: #0f7a3b;
  background: rgba(220, 252, 231, 0.92);
}

.sorting-wait .sorting-hero-card h2 {
  color: #082044;
  font-size: clamp(2rem, 5vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.82);
}

.sorting-wait .sorting-standby-copy {
  width: min(100%, 780px);
  margin-top: -6px;
  border-radius: 8px;
  padding: 0 clamp(4px, 1vw, 10px);
  color: #154056;
  font-size: clamp(1rem, 2.1vw, 1.18rem);
  font-weight: 750;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.sorting-wait .sorting-rings {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 18px);
  margin-top: clamp(4px, 1vw, 8px);
}

.sorting-wait .sorting-rings span {
  position: relative;
  min-height: clamp(144px, 17vw, 176px);
  align-content: end;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  padding: 18px 12px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.84)),
    rgba(255, 255, 255, 0.88);
  box-shadow:
    0 18px 34px rgba(20, 40, 30, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  animation: sortingCardFloat 3.8s ease-in-out infinite;
}

.sorting-wait .sorting-rings span:nth-child(2) { animation-delay: 0.24s; }
.sorting-wait .sorting-rings span:nth-child(3) { animation-delay: 0.48s; }
.sorting-wait .sorting-rings span:nth-child(4) { animation-delay: 0.72s; }

.sorting-wait .sorting-rings span::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 56px;
  height: 10px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.12);
  filter: blur(6px);
  z-index: 0;
}

.sorting-wait .sorting-rings img {
  position: relative;
  z-index: 1;
  width: min(98px, 70%);
  height: clamp(70px, 9vw, 94px);
  filter: drop-shadow(0 16px 16px rgba(15, 23, 42, 0.18));
}

.sorting-wait .sorting-rings strong {
  position: relative;
  z-index: 1;
  color: #092436;
  font-size: clamp(1.05rem, 2vw, 1.24rem);
  line-height: 1.2;
}

.sorting-wait .sorting-rings small {
  position: relative;
  z-index: 1;
  color: #2d5060;
  font-size: 0.9rem;
}

.sorting-wait .sorting-rings .ring-blue { box-shadow: inset 0 4px 0 #0ea5e9, 0 18px 34px rgba(14, 165, 233, 0.15); }
.sorting-wait .sorting-rings .ring-green { box-shadow: inset 0 4px 0 #22c55e, 0 18px 34px rgba(34, 197, 94, 0.15); }
.sorting-wait .sorting-rings .ring-red { box-shadow: inset 0 4px 0 #fb415d, 0 18px 34px rgba(244, 63, 94, 0.14); }
.sorting-wait .sorting-rings .ring-gray { box-shadow: inset 0 4px 0 #64748b, 0 18px 34px rgba(100, 116, 139, 0.14); }

.sorting-wait .sorting-wait-status {
  width: min(100%, 760px);
  margin: 0 auto;
  border-color: rgba(22, 163, 74, 0.26);
  background: rgba(236, 253, 245, 0.78);
  box-shadow:
    0 12px 26px rgba(22, 101, 52, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
}

.sorting-wait .sorting-wait-status strong {
  color: #0f3b2e;
  font-size: 1rem;
}

@keyframes sortingCardFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

@media (max-width: 620px) {
  .sorting-game .trash-card-grid {
    width: 100%;
    grid-template-columns: repeat(3, minmax(118px, 1fr));
    justify-content: start;
    overflow-x: auto;
    padding: 4px 2px 10px;
    scroll-snap-type: x proximity;
  }

  .sorting-game .trash-card-grid .trash-card {
    width: 100%;
    scroll-snap-align: center;
  }
}
