:root {
  --bg: #f6f5fb;
  --bg-green: #eefaf4;
  --surface: #ffffff;
  --surface-soft: #faf8ff;
  --text: #231a33;
  --muted: #766d84;
  --line: #ddd4ea;
  --line-strong: #c8bdd9;
  --green: #11a678;
  --green-strong: #08765e;
  --green-soft: #e2f7ef;
  --purple: #7556e8;
  --purple-strong: #4a319f;
  --purple-soft: #eee9ff;
  --plum: #332044;
  --amber: #9b6815;
  --danger: #b33a54;
  --danger-soft: #fde9ef;
  --blue: #2f6f9f;
  --cyan-soft: #e7f7fb;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --shadow: 0 24px 54px rgba(45, 31, 67, 0.13);
  --shadow-soft: 0 12px 32px rgba(45, 31, 67, 0.08);
  --shadow-line: 0 1px 0 rgba(255, 255, 255, 0.86) inset;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(115deg, rgba(117, 86, 232, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(247, 243, 255, 0.96) 0%, rgba(241, 250, 245, 0.92) 48%, rgba(250, 248, 252, 0.98) 100%),
    var(--bg);
  color: var(--text);
  font: 15px/1.52 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(117, 86, 232, 0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 166, 120, 0.026) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), transparent 76%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), transparent 76%);
}

a {
  color: var(--purple-strong);
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  color: var(--green-strong);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(109, 75, 217, 0.28);
  outline-offset: 2px;
}

.topbar {
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 44px);
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(117, 86, 232, 0.12);
  background: rgba(255, 255, 255, 0.74);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(22px) saturate(1.18);
  box-shadow: 0 10px 30px rgba(45, 31, 67, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--plum);
  font-weight: 900;
}

.brand:hover {
  color: var(--plum);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 42%),
    linear-gradient(135deg, var(--green), var(--purple));
  color: white;
  box-shadow: 0 14px 28px rgba(117, 86, 232, 0.24);
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  border: 1px solid transparent;
}

.nav a:hover {
  border-color: rgba(117, 86, 232, 0.12);
  background: rgba(238, 233, 255, 0.78);
  color: var(--purple-strong);
}

.mobile-menu {
  display: none;
  margin-left: auto;
  position: relative;
}

.mobile-menu summary {
  list-style: none;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(117, 86, 232, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 233, 255, 0.78));
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.mobile-menu-button span {
  width: 20px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: var(--plum);
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.mobile-menu[open] .mobile-menu-button span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu[open] .mobile-menu-button span:nth-child(2) {
  opacity: 0;
}

.mobile-menu[open] .mobile-menu-button span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(340px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid rgba(117, 86, 232, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.14);
}

.mobile-account {
  margin-bottom: 10px;
  padding: 10px 11px;
  border-radius: 8px;
  background: rgba(238, 233, 255, 0.64);
  color: var(--plum);
  font-weight: 900;
}

.mobile-nav {
  display: grid;
  gap: 6px;
}

.mobile-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
}

.mobile-nav a:hover {
  border-color: rgba(20, 154, 120, 0.18);
  background: rgba(226, 247, 239, 0.74);
  color: var(--green-strong);
}

.mobile-logout {
  width: 100%;
  margin-top: 10px;
  justify-content: center;
}

.account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto 72px;
}

.auth-layout {
  min-height: calc(100vh - 160px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: clamp(28px, 7vw, 92px);
  align-items: center;
}

.auth-copy {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  display: grid;
  align-content: end;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(117, 86, 232, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.72) 52%, rgba(255, 255, 255, 0.12) 100%),
    url("/static/assets/ksigma-hero-bg.png") right center / cover no-repeat;
  box-shadow: var(--shadow-soft);
}

.auth-copy::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--purple), var(--blue));
}

.auth-copy::after {
  content: "";
  position: absolute;
  right: clamp(14px, 3vw, 34px);
  bottom: -26px;
  width: clamp(150px, 20vw, 248px);
  aspect-ratio: 1;
  background: url("/static/assets/ksigma-anteater.png") bottom right / contain no-repeat;
  filter: drop-shadow(0 22px 32px rgba(47, 25, 75, 0.18));
  pointer-events: none;
  z-index: 0;
}

.auth-copy > * {
  position: relative;
  z-index: 1;
}

.auth-copy h1,
.page-header h1 {
  margin: 0;
  color: var(--plum);
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
}

.catalog-hero,
.course-detail-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 24px;
  align-items: center;
  margin-bottom: 26px;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid rgba(117, 86, 232, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.96), rgba(244, 255, 249, 0.78)),
    url("/static/assets/ksigma-hero-bg.png") right center / cover no-repeat;
  box-shadow: var(--shadow-soft);
}

.catalog-hero {
  grid-template-columns: minmax(0, 1fr) auto;
}

.catalog-hero h1,
.course-detail-copy h1 {
  margin: 0;
  color: var(--plum);
  font-size: clamp(36px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.catalog-hero p,
.course-detail-copy p {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.course-card {
  overflow: hidden;
  border: 1px solid rgba(117, 86, 232, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft), var(--shadow-line);
}

.course-card-media {
  display: block;
  height: 180px;
  background: var(--purple-soft);
}

.course-card-media img,
.course-detail-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.course-card-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.course-card-head,
.course-meta-row,
.course-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.course-card h2 {
  margin: 0;
  color: var(--plum);
  font-size: 24px;
  line-height: 1.08;
}

.course-card p {
  min-height: 68px;
  margin: 0;
  color: var(--muted);
}

.course-meta-row span,
.course-detail-meta span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid rgba(17, 166, 120, 0.16);
  border-radius: 8px;
  background: rgba(226, 247, 239, 0.7);
  color: var(--green-strong);
  font-weight: 800;
}

.course-detail-hero {
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
}

.course-detail-copy {
  display: grid;
  gap: 14px;
}

.course-detail-media {
  overflow: hidden;
  min-height: 320px;
  border-radius: 8px;
  border: 1px solid rgba(117, 86, 232, 0.12);
  box-shadow: 0 22px 42px rgba(45, 31, 67, 0.14);
}

.purchase-note {
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(17, 166, 120, 0.18);
  border-radius: 8px;
  background: rgba(226, 247, 239, 0.75);
  color: var(--green-strong);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-strong);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
}

.auth-panel,
.panel,
.stat,
.referral-box {
  background: var(--surface-glass);
  border: 1px solid rgba(117, 86, 232, 0.13);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.05);
}

.auth-panel,
.panel {
  padding: 22px;
}

.auth-panel {
  display: grid;
  gap: 16px;
  border-top: 4px solid var(--purple);
  box-shadow: var(--shadow);
}

.panel {
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft), var(--shadow-line);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--green), var(--purple));
}

.embedded-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(117, 86, 232, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(226, 247, 239, 0.55), transparent 42%),
    rgba(255, 255, 255, 0.62);
}

.embedded-panel .submission-chat-form {
  margin-bottom: 0;
}

.page-header {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(117, 86, 232, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.78) 48%, rgba(255, 255, 255, 0.08) 100%),
    url("/static/assets/ksigma-hero-bg.png") right center / cover no-repeat;
  box-shadow: var(--shadow-soft);
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--purple), var(--blue));
}

.page-header::after {
  content: "";
  position: absolute;
  right: clamp(14px, 4vw, 46px);
  bottom: -42px;
  width: clamp(120px, 17vw, 210px);
  aspect-ratio: 1;
  background: url("/static/assets/ksigma-anteater.png") bottom right / contain no-repeat;
  filter: drop-shadow(0 22px 34px rgba(47, 25, 75, 0.18));
  opacity: 0.28;
  pointer-events: none;
}

.page-header > * {
  position: relative;
  z-index: 1;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.wide-panel,
.stats-grid {
  margin-bottom: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-color: rgba(17, 166, 120, 0.16);
}

.stat::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(117, 86, 232, 0.12);
  background: linear-gradient(135deg, rgba(17, 166, 120, 0.12), rgba(117, 86, 232, 0.16));
}

.stat span,
.referral-box span,
.meta-list dt,
.hint,
.muted,
.empty,
small {
  color: var(--muted);
}

.stat strong {
  display: block;
  margin-top: 4px;
  color: var(--purple-strong);
  font-size: 28px;
  line-height: 1;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--plum);
  font-size: 20px;
  line-height: 1.18;
}

.analytics-filter-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.analytics-summary-grid .stat small {
  display: block;
  margin-top: 6px;
  font-weight: 900;
}

.analytics-status-list,
.analytics-metric-list {
  display: grid;
  gap: 12px;
}

.analytics-status-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(120px, 220px) 46px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(117, 86, 232, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.analytics-status-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.analytics-status-row strong,
.analytics-metric strong {
  color: var(--purple-strong);
  font-size: 22px;
  line-height: 1;
}

.analytics-status-row meter {
  width: 100%;
  height: 12px;
}

.analytics-status-row meter::-webkit-meter-bar {
  border: 0;
  border-radius: 999px;
  background: rgba(109, 75, 217, 0.12);
}

.analytics-status-row meter::-webkit-meter-optimum-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--purple));
}

.analytics-metric {
  display: grid;
  gap: 5px;
  min-height: 92px;
  align-content: center;
  padding: 14px;
  border: 1px solid rgba(117, 86, 232, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(226, 247, 239, 0.66), transparent 46%),
    rgba(255, 255, 255, 0.68);
}

.analytics-metric span {
  color: var(--plum);
  font-weight: 900;
}

.analytics-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--plum);
  font-weight: 800;
}

.check-mode-field {
  display: grid;
  gap: 10px;
  margin: 0;
  border: 0;
  padding: 0;
}

.check-mode-field legend {
  margin-bottom: 2px;
  color: var(--plum);
  font-weight: 900;
}

.check-mode-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(117, 86, 232, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.check-mode-card input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 0;
  padding: 0;
  background: transparent;
  accent-color: var(--green);
}

.check-mode-card span {
  display: grid;
  gap: 3px;
}

.check-mode-card strong {
  color: var(--plum);
}

.ai-mode-card {
  border-color: rgba(17, 166, 120, 0.2);
  background:
    linear-gradient(135deg, rgba(226, 247, 239, 0.72), transparent 54%),
    rgba(255, 255, 255, 0.78);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(117, 86, 232, 0.16);
  border-radius: 8px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--purple);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(117, 86, 232, 0.11);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 8px;
  padding: 8px 11px;
  background: var(--purple-soft);
  color: var(--purple-strong);
  font: inherit;
  font-weight: 800;
}

textarea {
  resize: vertical;
}

form {
  margin: 0;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.compact-form {
  margin-top: 2px;
}

.code-input {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 4px;
  text-align: center;
}

.primary-button,
.ghost-button,
.danger-button,
.ghost-link-button {
  border: 0;
  border-radius: 8px;
  padding: 11px 15px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.primary-button {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 40%),
    linear-gradient(135deg, var(--green), var(--green-strong));
  color: white;
  box-shadow: 0 14px 24px rgba(17, 166, 120, 0.22);
}

.primary-button:hover {
  background: linear-gradient(135deg, #18a983, var(--green-strong));
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(20, 154, 120, 0.24);
}

.ghost-button {
  border: 1px solid rgba(117, 86, 232, 0.14);
  background: rgba(238, 233, 255, 0.82);
  color: var(--purple-strong);
}

.ghost-link-button {
  display: inline-flex;
  justify-content: center;
  background: var(--purple-soft);
  color: var(--purple-strong);
}

.ghost-button:hover,
.ghost-link-button:hover {
  background: #e7defd;
  color: var(--purple-strong);
}

button:disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.danger-button {
  background: var(--danger);
  color: white;
}

.danger-button:hover {
  background: #982d45;
}

.compact {
  padding: 8px 11px;
  white-space: nowrap;
}

.badge,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge {
  border-color: rgba(17, 166, 120, 0.14);
  background: rgba(226, 247, 239, 0.86);
  color: var(--green-strong);
}

.muted-badge {
  border-color: rgba(117, 86, 232, 0.12);
  background: rgba(238, 233, 255, 0.84);
  color: var(--purple-strong);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status.pending,
.status.open,
.status.started,
.status.uploaded,
.status.processing {
  background: #fff4dc;
  color: var(--amber);
}

.status.assigned,
.status.replied,
.status.answered {
  background: var(--purple-soft);
  color: var(--purple-strong);
}

.status.closed,
.status.submitted,
.status.ready,
.status.success {
  background: var(--green-soft);
  color: var(--green-strong);
}

.status.failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.status.cancelled,
.status.declined {
  background: var(--danger-soft);
  color: var(--danger);
}

.status.big {
  font-size: 15px;
  padding: 8px 12px;
}

.error-text {
  color: var(--danger);
  font-weight: 800;
}

.notice-text {
  margin: 14px 0 0;
  color: var(--green-strong);
  font-weight: 850;
}

.referral-box {
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  min-width: 190px;
  border-color: rgba(20, 154, 120, 0.18);
}

.referral-box strong {
  color: var(--purple-strong);
  font-size: 18px;
}

.panel > .empty {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  margin: 0;
  padding: 18px 170px 18px 92px;
  background: url("/static/assets/ksigma-empty-state.png") left center / 74px 74px no-repeat;
}

.panel > .empty::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: -32px;
  width: 150px;
  aspect-ratio: 1;
  background: url("/static/assets/ksigma-characters.png") bottom right / contain no-repeat;
  opacity: 0.28;
  filter: drop-shadow(0 18px 26px rgba(47, 25, 75, 0.12));
  pointer-events: none;
}

.media-admin-head .empty,
.leaderboard-list li.empty {
  min-height: 0;
  padding: 0;
  background: none;
}

.media-admin-head .empty::after,
.leaderboard-list li.empty::after {
  display: none;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(117, 86, 232, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

th,
td {
  padding: 13px 11px;
  text-align: left;
  border-bottom: 1px solid rgba(117, 86, 232, 0.09);
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(238, 233, 255, 0.38);
}

th {
  background: rgba(238, 233, 255, 0.56);
  color: var(--purple-strong);
  font-size: 13px;
  font-weight: 900;
}

.stack-list,
.message-list {
  display: grid;
  gap: 10px;
}

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

.lecture-card {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(117, 86, 232, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 248, 255, 0.88));
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.lecture-card:hover {
  border-color: rgba(20, 154, 120, 0.35);
  color: var(--text);
  transform: translateY(-1px);
}

.lecture-card strong {
  color: var(--plum);
  font-size: 18px;
}

.lecture-course,
.lecture-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.lecture-course {
  color: var(--green-strong);
}

.lecture-description {
  margin: 0 0 16px;
  color: var(--muted);
}

.lesson-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lesson-materials span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 12px;
  font-weight: 900;
}

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

.material-card {
  min-height: 108px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(117, 86, 232, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(231, 247, 251, 0.70), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 255, 249, 0.90));
  color: var(--text);
}

.material-card:hover {
  border-color: rgba(20, 154, 120, 0.38);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(52, 33, 68, 0.06);
}

.material-card span {
  color: var(--green-strong);
  font-size: 12px;
  font-weight: 900;
}

.material-card strong {
  color: var(--plum);
}

.upload-progress-panel,
.processing-loader {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(117, 86, 232, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(231, 247, 251, 0.62), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 255, 249, 0.92));
}

.upload-progress-panel[hidden] {
  display: none;
}

.upload-progress-panel[data-state="error"] {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff7f6;
}

.upload-progress-head,
.processing-loader-head,
.upload-progress-meta,
.processing-loader-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.upload-progress-head strong,
.processing-loader-head strong {
  color: var(--plum);
}

.upload-progress-head span,
.processing-loader-head span {
  color: var(--green-strong);
  font-size: 14px;
  font-weight: 900;
}

.upload-progress-meta,
.processing-loader-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-progress-bar,
.processing-loader-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(109, 75, 217, 0.12);
}

.upload-progress-bar span,
.processing-loader-bar span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-strong), #6d4bd9);
  transition: transform 180ms ease;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(109, 75, 217, 0.18);
  border-radius: 8px;
  background: #100b18;
  box-shadow: var(--shadow);
}

.secure-media-player {
  display: grid;
  gap: 12px;
}

.media-state {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.media-state:empty {
  display: none;
}

.media-state[data-kind="error"] {
  color: #b42318;
}

.media-state[data-kind="processing"] {
  color: var(--green-strong);
}

.secure-video-shell,
.secure-pdf-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(117, 86, 232, 0.18);
  border-radius: 8px;
  background: #100b18;
  box-shadow: var(--shadow);
}

.lecture-video {
  display: block;
  width: 100%;
  max-height: min(70vh, 720px);
  background: #100b18;
}

.video-watermark {
  position: absolute;
  pointer-events: none;
  user-select: none;
  color: rgba(255, 255, 255, 0.30);
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.video-watermark.corner {
  left: auto;
  top: auto;
  right: 16px;
  bottom: 14px;
  font-size: 13px;
  opacity: 0.55;
}

.video-watermark.ghost {
  left: 50%;
  top: 50%;
  width: 90%;
  transform: translate(-50%, -50%) rotate(-18deg);
  text-align: center;
  font-size: clamp(22px, 4vw, 52px);
  opacity: 0.08;
  letter-spacing: 0;
}

.secure-pdf-shell {
  display: grid;
  max-height: 78vh;
  background: #f8faf9;
}

.pdf-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(109, 75, 217, 0.16);
  background: rgba(255, 255, 255, 0.94);
  color: var(--plum);
}

.pdf-pager {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-left: auto;
}

.pdf-pager-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(109, 75, 217, 0.18);
  border-radius: 8px;
  background: rgba(246, 241, 255, 0.95);
  color: var(--purple);
  font: inherit;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.pdf-pager-button:hover:not(:disabled) {
  border-color: rgba(9, 154, 107, 0.38);
  color: var(--green-strong);
}

.pdf-pager-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.pdf-page-input {
  width: 64px;
  min-height: 38px;
  border: 1px solid rgba(109, 75, 217, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--plum);
  font: inherit;
  font-weight: 900;
  text-align: center;
}

.pdf-page-total {
  color: var(--muted);
  font-weight: 900;
}

.secure-pdf-pages {
  overflow: auto;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 18px;
}

.pdf-frame {
  width: 100%;
  height: 74vh;
  border: 0;
  background: #fff;
}

.pdf-canvas-page,
.pdf-image-page img {
  display: block;
  width: min(100%, 980px);
  height: auto;
  border: 1px solid rgba(109, 75, 217, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(44, 31, 61, 0.10);
}

.pdf-image-page {
  width: min(100%, 980px);
  min-height: min(62vh, 760px);
  display: grid;
  place-items: center;
  border: 1px dashed rgba(109, 75, 217, 0.20);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.pdf-image-page:has(img) {
  min-height: 0;
  border: 0;
  background: transparent;
}

.pdf-image-page.is-error {
  color: #b42318;
}

.pdf-watermark {
  color: rgba(70, 52, 94, 0.16);
  text-shadow: none;
}

@media (max-width: 720px) {
  .pdf-toolbar {
    align-items: stretch;
  }

  .pdf-toolbar strong {
    width: 100%;
  }

  .pdf-pager {
    order: 2;
    width: 100%;
    margin-left: 0;
  }

  #pdf-page-count {
    order: 1;
    margin-left: auto;
  }
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(117, 86, 232, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(231, 247, 251, 0.52), transparent 54%),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

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

.inline-delete-form,
.inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-delete-form {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-checkbox {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(179, 58, 84, 0.18);
  border-radius: 8px;
  background: rgba(253, 233, 239, 0.58);
  color: var(--danger);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.list-row:hover {
  border-color: rgba(20, 154, 120, 0.35);
  box-shadow: 0 12px 24px rgba(45, 31, 67, 0.08);
  transform: translateY(-1px);
}

.media-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.media-admin-row {
  align-items: flex-start;
}

.list-row span {
  min-width: 0;
}

.list-row strong,
.list-row small {
  display: block;
  overflow-wrap: anywhere;
}

.role-list .list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px auto;
}

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

.access-card {
  border: 1px solid rgba(117, 86, 232, 0.13);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(238, 233, 255, 0.64), transparent 54%),
    rgba(255, 255, 255, 0.90);
  box-shadow: var(--shadow-soft);
}

.access-head,
.role-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.student-name-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 10px 0 2px;
  padding: 10px;
  border: 1px solid rgba(20, 154, 120, 0.14);
  border-radius: 8px;
  background: rgba(231, 248, 241, 0.54);
}

.student-name-form .form-caption {
  grid-column: 1 / -1;
  margin-top: 0;
}

.access-head {
  align-items: start;
  margin-bottom: 12px;
}

.access-head strong,
.access-head small {
  display: block;
  overflow-wrap: anywhere;
}

.course-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(117, 86, 232, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  font-weight: 800;
}

.check-row:hover {
  border-color: rgba(20, 154, 120, 0.38);
  background: #ffffff;
}

.admin-check-row {
  background: rgba(238, 233, 255, 0.74);
}

.form-caption {
  margin: 14px 0 0;
  color: var(--purple-strong);
  font-weight: 900;
}

.grader-assignment-box {
  margin-top: 12px;
}

.grader-assignment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 8px;
}

.meta-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.meta-list div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
}

.meta-list dt,
.meta-list dd {
  margin: 0;
}

.message {
  padding: 14px;
  border: 1px solid rgba(117, 86, 232, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(231, 247, 251, 0.46), transparent 48%),
    rgba(255, 255, 255, 0.90);
  box-shadow: var(--shadow-soft);
}

.message header {
  margin-bottom: 8px;
  color: var(--purple-strong);
  font-size: 13px;
  font-weight: 900;
}

.message p {
  margin: 0 0 10px;
  white-space: pre-wrap;
}

.submission-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.file-drop input {
  margin-top: 6px;
}

.file-drop span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.submission-chat-list {
  margin-top: 8px;
}

.chat-message {
  background:
    radial-gradient(circle at top right, rgba(20, 154, 120, 0.12), transparent 34%),
    rgba(255, 255, 255, 0.94);
}

.chat-message.own-message {
  border-color: rgba(20, 154, 120, 0.24);
  background:
    radial-gradient(circle at top left, rgba(117, 86, 232, 0.12), transparent 34%),
    rgba(249, 252, 250, 0.95);
}

.chat-message header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.attachment-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid rgba(117, 86, 232, 0.16);
  border-radius: 8px;
  background: rgba(238, 233, 255, 0.58);
  color: var(--purple-strong);
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.attachment-pill:hover {
  border-color: rgba(20, 154, 120, 0.35);
  color: var(--green-strong);
}

blockquote {
  margin: 10px 0 0;
  padding: 11px 0 11px 14px;
  border-left: 4px solid var(--green);
  color: var(--text);
  background: rgba(228, 246, 239, 0.46);
}

.inline-form,
.rating-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.rating-form {
  grid-template-columns: 150px minmax(0, 1fr) auto;
}

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

.top-gap {
  margin-top: 14px;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  border: 1px solid rgba(179, 58, 84, 0.22);
}

.alert.error {
  background: var(--danger-soft);
  color: #83263a;
}

.alert.success {
  border-color: rgba(20, 154, 120, 0.24);
  background: var(--green-soft);
  color: var(--green-strong);
}

.game-titlebar {
  align-items: center;
}

.game-personal {
  min-width: 170px;
}

.game-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.game-tab.is-active {
  background: var(--green-soft);
  color: var(--green-strong);
  box-shadow: inset 0 0 0 1px rgba(20, 154, 120, 0.24);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.game-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(109, 75, 217, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.game-panel {
  display: none;
}

.game-panel.is-active {
  display: block;
}

.game-hud {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 88px;
  gap: 12px;
  align-items: center;
  margin: 14px;
}

.game-hud > div:not(.game-timer) {
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid rgba(109, 75, 217, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(52, 33, 68, 0.08);
}

.game-hud span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.game-hud strong {
  display: block;
  color: var(--plum);
  font-size: 24px;
  line-height: 1;
}

.game-timer {
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(20, 154, 120, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}

.corsaires-speed {
  border-color: rgba(109, 75, 217, 0.24);
}

.flappy-flow {
  border-color: rgba(20, 154, 120, 0.28);
}

.tetris-game .game-hud {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.game-timer span {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--green), var(--purple));
}

.game-canvas-shell {
  position: relative;
  margin-top: 0;
}

.arcade-canvas,
.lumberjack-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 6 / 7;
  min-height: 480px;
  touch-action: manipulation;
}

.corsaires-canvas {
  background: #e9f9f1;
}

.flappy-canvas {
  background: #ddf8ff;
}

.tetris-canvas {
  width: min(100%, 520px);
  margin: 0 auto;
  aspect-ratio: 5 / 9;
  background: #f3fff8;
}

.math-game {
  position: relative;
  min-height: 640px;
  padding: 92px 22px 22px;
  display: grid;
  gap: 18px;
  align-content: center;
  background:
    linear-gradient(180deg, rgba(238, 232, 251, 0.76), rgba(228, 246, 239, 0.72)),
    #ffffff;
}

.math-hud {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.math-hud > div {
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid rgba(109, 75, 217, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(52, 33, 68, 0.08);
}

.math-hud span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.math-hud strong {
  display: block;
  color: var(--plum);
  font-size: 24px;
  line-height: 1;
}

.math-timer {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 82px;
  height: 15px;
  overflow: hidden;
  border: 1px solid rgba(20, 154, 120, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}

.math-timer span {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--green), var(--purple));
}

.math-question {
  min-height: 140px;
  display: grid;
  place-items: center;
  color: var(--plum);
  font-size: clamp(48px, 9vw, 92px);
  font-weight: 950;
  line-height: 1;
}

.math-answer {
  width: min(560px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.word-game {
  position: relative;
  min-height: 620px;
  padding: 20px;
  display: grid;
  gap: 14px;
  align-content: start;
  justify-items: center;
  background: #ffffff;
}

.word-hud {
  position: static;
  width: min(100%, 460px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.word-hud > div {
  min-height: 48px;
  padding: 7px 9px;
  border-color: #ece8f5;
  border-radius: 6px;
  box-shadow: none;
}

.word-hud span {
  color: #6f637d;
}

.word-hud strong {
  color: #342144;
  font-size: 22px;
}

.word-board {
  width: min(100%, 360px);
  margin: 6px auto 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.word-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  border: 2px solid #d3d6da;
  border-radius: 3px;
  background: #ffffff;
  color: #1f1f24;
  font-size: clamp(28px, 7vw, 42px);
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
}

.word-cell:not(:empty) {
  border-color: #878a8c;
  animation: word-pop 130ms ease-out;
}

.word-cell.is-invalid {
  animation: word-shake 300ms ease-in-out;
}

.word-cell[data-status="exact"],
.word-key[data-status="exact"] {
  border-color: #6aaa64;
  background: #6aaa64;
  color: #ffffff;
}

.word-cell[data-status="present"],
.word-key[data-status="present"] {
  border-color: #c9b458;
  background: #c9b458;
  color: #ffffff;
}

.word-cell[data-status="absent"],
.word-key[data-status="absent"] {
  border-color: #787c7e;
  background: #787c7e;
  color: #ffffff;
}

.word-form {
  width: min(520px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.word-hidden-form {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.word-form input {
  text-align: center;
  text-transform: uppercase;
  font-size: 24px;
  font-weight: 1000;
  letter-spacing: 0;
}

.word-keyboard {
  display: grid;
  gap: 8px;
  width: min(100%, 620px);
  margin: 2px auto 0;
}

.word-key-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.word-key {
  min-width: 34px;
  height: 48px;
  border: 0;
  border-radius: 4px;
  padding: 0 9px;
  background: #d3d6da;
  color: #1f1f24;
  font: inherit;
  font-size: 15px;
  font-weight: 950;
  text-transform: uppercase;
  cursor: pointer;
}

.word-key[data-action="enter"],
.word-key[data-action="backspace"] {
  min-width: 62px;
  background: #b6bbc2;
  color: #1f1f24;
}

.word-message {
  min-height: 22px;
  margin: 0;
  color: #6f637d;
  text-align: center;
  font-size: 14px;
  font-weight: 850;
}

.word-message[data-kind="success"] {
  color: var(--green-strong);
}

.word-message[data-kind="error"] {
  color: var(--danger);
}

.chess-game {
  position: relative;
  min-height: 680px;
  padding: 92px 18px 18px;
  display: grid;
  gap: 14px;
  align-content: start;
  background:
    linear-gradient(135deg, rgba(240, 237, 255, 0.76), rgba(231, 248, 241, 0.72)),
    #ffffff;
}

.chess-hud {
  z-index: 2;
}

.chess-shell {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(220px, 1fr);
  gap: 14px;
  align-items: start;
}

.chess-board-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
}

.chess-board {
  width: min(100%, 560px);
  min-width: 280px;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(52, 33, 68, 0.24);
  border-radius: 8px;
  background: #f6fff9;
  box-shadow:
    0 20px 42px rgba(39, 25, 61, 0.13),
    inset 0 0 0 5px rgba(255, 255, 255, 0.62);
}

.chess-square {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 0;
  padding: 0;
  color: #241832;
  font: inherit;
  font-size: 42px;
  font-family: "Arial Unicode MS", "Noto Sans Symbols 2", "Segoe UI Symbol", serif;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.chess-square[data-tone="light"] {
  background: #effbf5;
}

.chess-square[data-tone="dark"] {
  background: #7665f0;
}

.chess-square[data-color="b"] {
  color: #084d42;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.58),
    0 7px 13px rgba(39, 25, 61, 0.24);
}

.chess-square[data-color="w"] {
  color: #342144;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.80),
    0 7px 13px rgba(39, 25, 61, 0.20);
}

.chess-square.is-selected {
  box-shadow: inset 0 0 0 4px rgba(13, 135, 104, 0.78);
}

.chess-square.is-last {
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.52);
}

.chess-square.is-target::after,
.chess-square.is-capture::after {
  content: "";
  width: 32%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(13, 135, 104, 0.44);
}

.chess-square.is-capture::after {
  position: absolute;
  inset: 8px;
  width: auto;
  border: 3px solid rgba(13, 135, 104, 0.64);
  background: transparent;
}

.chess-square.is-check {
  background: linear-gradient(135deg, #fff0f3, #f68aa3);
}

.chess-side {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(109, 75, 217, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.chess-status {
  min-height: 66px;
  margin: 0;
  color: var(--plum);
  font-weight: 850;
}

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

.chess-levels .is-active {
  background: var(--green-soft);
  color: var(--green-strong);
  box-shadow: inset 0 0 0 1px rgba(20, 154, 120, 0.24);
}

.chess-log {
  display: grid;
  gap: 6px;
  max-height: 270px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.chess-log li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(109, 75, 217, 0.10);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--plum);
  font-size: 13px;
  font-weight: 850;
}

.chess-log span {
  color: var(--purple-strong);
  font-weight: 950;
}

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

@keyframes word-pop {
  0% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

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

.puzzle-game,
.tetris-game {
  position: relative;
  min-height: 640px;
  padding: 92px 22px 22px;
  display: grid;
  gap: 18px;
  align-content: center;
  background:
    radial-gradient(circle at 20% 14%, rgba(20, 154, 120, 0.16), transparent 28%),
    radial-gradient(circle at 80% 18%, rgba(109, 75, 217, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(238, 232, 251, 0.62), rgba(228, 246, 239, 0.70)),
    #ffffff;
}

.puzzle-hud {
  z-index: 2;
}

.grid-2048-shell {
  display: grid;
  place-items: center;
  padding: 8px;
}

.grid-2048 {
  width: min(100%, 430px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(109, 75, 217, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(109, 75, 217, 0.18), rgba(20, 154, 120, 0.18));
  box-shadow: 0 16px 38px rgba(52, 33, 68, 0.12);
}

.tile-2048 {
  display: grid;
  place-items: center;
  min-width: 0;
  border-radius: 8px;
  border: 1px solid rgba(109, 75, 217, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: var(--plum);
  font-size: clamp(20px, 5vw, 42px);
  font-weight: 1000;
  line-height: 1;
  box-shadow: inset 0 -4px 0 rgba(52, 33, 68, 0.06);
}

.tile-2048[data-value="2"],
.tile-2048[data-value="4"] {
  background: #f4fff9;
}

.tile-2048[data-value="8"],
.tile-2048[data-value="16"] {
  background: #dff7eb;
  color: #0f7b62;
}

.tile-2048[data-value="32"],
.tile-2048[data-value="64"] {
  background: #eee8fb;
  color: var(--purple-strong);
}

.tile-2048[data-value="128"],
.tile-2048[data-value="256"] {
  background: linear-gradient(135deg, #d9fff0, #dcd3fb);
  color: var(--plum);
}

.tile-2048[data-value="512"],
.tile-2048[data-value="1024"],
.tile-2048[data-value="2048"] {
  background: linear-gradient(135deg, var(--green), var(--purple));
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.26);
}

.puzzle-controls {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: center;
}

.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  place-items: center;
  gap: 14px;
  align-content: center;
  background: rgba(247, 243, 251, 0.52);
  backdrop-filter: blur(6px);
}

.game-overlay.is-visible {
  display: grid;
}

.game-overlay strong {
  color: var(--plum);
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
}

.game-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border-top: 1px solid rgba(109, 75, 217, 0.12);
  background: rgba(255, 255, 255, 0.92);
}

.lumber-button {
  min-height: 58px;
  font-size: 30px;
  line-height: 1;
}

.leaderboard-panel {
  max-height: calc(100vh - 126px);
  overflow: auto;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid rgba(109, 75, 217, 0.12);
  border-radius: 8px;
  background: #ffffff;
}

.leaderboard-list li.is-current {
  border-color: rgba(20, 154, 120, 0.36);
  background: var(--green-soft);
}

.leaderboard-list li.empty {
  display: block;
  color: var(--muted);
}

.leader-rank {
  color: var(--purple-strong);
  font-weight: 900;
}

.leader-name {
  overflow: hidden;
  color: var(--plum);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-name small {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.leaderboard-list strong {
  color: var(--green-strong);
  font-size: 18px;
}

.game-ratings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.course-admin-row {
  display: grid;
  gap: 12px;
}

.course-admin-main {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.course-admin-details {
  padding-top: 10px;
  border-top: 1px solid rgba(117, 86, 232, 0.11);
}

.course-admin-details summary {
  cursor: pointer;
  color: var(--purple-strong);
  font-weight: 900;
}

.course-catalog-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.course-catalog-form .wide-field {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .topbar {
    min-height: 62px;
    padding: 9px 12px;
    justify-content: space-between;
    gap: 12px;
  }

  .desktop-nav,
  .desktop-account {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .brand {
    min-width: 0;
  }

  .brand > span:last-child {
    overflow: hidden;
    max-width: 42vw;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 860px) {
  .page-header {
    align-items: flex-start;
  }

  .page-header,
  .auth-copy {
    min-height: 0;
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.82)),
      url("/static/assets/ksigma-hero-bg.png") right center / cover no-repeat;
  }

  .page-header::after {
    width: 130px;
    right: 8px;
    bottom: -46px;
    opacity: 0.18;
  }

  .auth-copy::after {
    width: 130px;
    right: 10px;
    bottom: -42px;
    opacity: 0.34;
  }

  .auth-layout,
  .split-grid,
  .stats-grid,
  .lecture-grid,
  .material-grid,
  .file-grid,
  .game-ratings-grid,
  .game-layout,
  .analytics-filter-form,
  .catalog-hero,
  .course-detail-hero,
  .course-catalog-form {
    grid-template-columns: 1fr;
  }

  .analytics-status-row {
    grid-template-columns: 1fr;
  }

  .leaderboard-panel {
    max-height: none;
  }

  .inline-form,
  .rating-form,
  .submission-chat-form,
  .role-list .list-row,
  .admin-user-list,
  .role-form,
  .student-name-form {
    grid-template-columns: 1fr;
  }

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

  .course-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .course-admin-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .course-detail-media {
    min-height: 220px;
  }

  .chess-shell {
    grid-template-columns: 1fr;
  }

  .chess-side {
    order: 2;
  }
}

@media (max-width: 520px) {
  .page {
    width: min(100% - 20px, 1180px);
    margin-top: 18px;
  }

  input,
  select,
  textarea {
    min-height: 48px;
    font-size: 16px;
  }

  input[type="file"]::file-selector-button {
    min-height: 44px;
  }

  .primary-button,
  .ghost-button,
  .danger-button,
  .ghost-link-button {
    min-height: 48px;
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
  }

  .mobile-menu-button {
    width: 48px;
    height: 48px;
  }

  .mobile-nav a {
    min-height: 48px;
  }

  .auth-panel,
  .panel {
    padding: 16px;
  }

  .page-header {
    padding: 22px;
  }

  .panel > .empty {
    min-height: 0;
    padding: 82px 0 0;
    background-position: left top;
    background-size: 70px 70px;
  }

  .panel > .empty::after {
    width: 88px;
    right: 0;
    bottom: auto;
    top: -6px;
    opacity: 0.2;
  }

  .game-hud {
    grid-template-columns: 70px minmax(0, 1fr) 70px;
    gap: 8px;
    margin: 10px;
  }

  .game-hud > div:not(.game-timer) {
    min-height: 48px;
    padding: 7px 8px;
  }

  .game-hud strong {
    font-size: 20px;
  }

  .arcade-canvas,
  .lumberjack-canvas {
    min-height: 390px;
  }

  .math-game {
    min-height: 500px;
    padding-inline: 14px;
  }

  .word-game {
    min-height: 560px;
    padding: 14px 10px 16px;
  }

  .word-hud {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .word-hud > div {
    min-height: 44px;
    padding: 6px;
  }

  .word-hud strong {
    font-size: 18px;
  }

  .word-board {
    gap: 6px;
    width: min(100%, 320px);
  }

  .word-form {
    grid-template-columns: 1fr;
  }

  .word-key-row {
    gap: 3px;
  }

  .word-key {
    min-width: 26px;
    min-height: 38px;
    height: 40px;
    padding: 0 5px;
    font-size: 13px;
  }

  .word-key[data-action="enter"],
  .word-key[data-action="backspace"] {
    min-width: 44px;
  }

  .chess-game {
    min-height: 560px;
    padding: 206px 10px 12px;
  }

  .chess-square {
    font-size: 28px;
  }

  .chess-side {
    padding: 10px;
  }

  .chess-status {
    min-height: 0;
    font-size: 14px;
  }

  .chess-levels,
  .chess-controls {
    grid-template-columns: 1fr;
  }

  .math-answer,
  .math-hud {
    grid-template-columns: 1fr;
  }

  .word-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .math-timer {
    top: 206px;
  }

  .math-question {
    margin-top: 118px;
    min-height: 116px;
  }

  .meta-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .answers-grid {
    grid-template-columns: 1fr;
  }
}

/* Modern interface pass */
:root {
  --bg: #f7f8fc;
  --bg-green: #eef9f4;
  --surface: #ffffff;
  --surface-soft: #f7f4ff;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --text: #21172f;
  --muted: #706a7c;
  --line: #e8e1f2;
  --line-strong: #cec2e2;
  --green: #16ae86;
  --green-strong: #08755f;
  --green-soft: #e7f8f1;
  --purple: #7665f0;
  --purple-strong: #4931a0;
  --purple-soft: #f0edff;
  --plum: #2f1d42;
  --amber: #946316;
  --danger: #b33a54;
  --danger-soft: #fff0f4;
  --blue: #327ca8;
  --cyan-soft: #ecf9fd;
  --rose-soft: #fff3f5;
  --shadow: 0 18px 42px rgba(39, 25, 61, 0.10);
  --shadow-soft: 0 10px 28px rgba(39, 25, 61, 0.07);
  --shadow-line: 0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

html {
  background: var(--bg);
}

body {
  background:
    linear-gradient(135deg, rgba(240, 237, 255, 0.88) 0%, rgba(247, 248, 252, 0.94) 32%, rgba(231, 248, 241, 0.78) 72%, rgba(255, 243, 245, 0.62) 100%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

body::before {
  opacity: 0.42;
  background:
    linear-gradient(rgba(118, 101, 240, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 174, 134, 0.020) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 78%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 78%);
}

a {
  color: var(--purple-strong);
}

a:hover {
  color: var(--green-strong);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(22, 174, 134, 0.22);
  outline-offset: 2px;
}

.topbar {
  min-height: 64px;
  padding: 10px 34px;
  gap: 18px;
  border-bottom: 1px solid rgba(87, 73, 127, 0.10);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 24px rgba(39, 25, 61, 0.045);
}

.brand {
  gap: 9px;
  color: var(--plum);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), transparent 44%),
    linear-gradient(135deg, #11b58b, #7b67f2);
  box-shadow: 0 12px 26px rgba(74, 49, 159, 0.18);
}

.nav {
  gap: 5px;
}

.nav a {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #655d72;
  font-size: 14px;
  font-weight: 850;
}

.nav a:hover {
  border-color: rgba(118, 101, 240, 0.14);
  background: rgba(240, 237, 255, 0.72);
  color: var(--purple-strong);
}

.account {
  gap: 10px;
  font-size: 14px;
}

.page {
  width: min(1240px, calc(100% - 40px));
  margin-top: 24px;
}

.auth-copy,
.catalog-hero,
.course-detail-hero,
.page-header {
  border-color: rgba(87, 73, 127, 0.10);
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.84) 48%, rgba(241, 251, 246, 0.72) 100%),
    url("/static/assets/ksigma-hero-bg.png") right center / cover no-repeat;
  box-shadow: 0 14px 34px rgba(39, 25, 61, 0.075);
}

.page-header {
  min-height: 146px;
  margin-bottom: 18px;
  padding: 30px 34px;
  align-items: center;
}

.page-header::before,
.auth-copy::before,
.panel::before {
  height: 3px;
  background: linear-gradient(90deg, #13ad83, #4e91c2 48%, #7665f0);
}

.page-header::after {
  right: 28px;
  bottom: -54px;
  width: 172px;
  opacity: 0.16;
}

.auth-copy h1,
.page-header h1 {
  color: var(--plum);
  font-size: 44px;
  line-height: 1.04;
  letter-spacing: 0;
}

.catalog-hero h1,
.course-detail-copy h1 {
  color: var(--plum);
  font-size: 56px;
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-copy p,
.catalog-hero p,
.course-detail-copy p,
.lecture-description {
  color: var(--muted);
  font-size: 17px;
}

.eyebrow {
  color: var(--green-strong);
  font-size: 12px;
  letter-spacing: 0;
}

.auth-panel,
.panel,
.stat,
.referral-box,
.embedded-panel,
.course-card,
.lecture-card,
.material-card,
.list-row,
.access-card,
.message,
.analytics-status-row,
.analytics-metric,
.table-wrap,
.secure-video-shell,
.secure-pdf-shell,
.video-shell,
.game-stage,
.game-panel,
.leaderboard-list li {
  border-color: rgba(87, 73, 127, 0.11);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(39, 25, 61, 0.065), var(--shadow-line);
}

.auth-panel,
.panel {
  padding: 24px;
}

.panel {
  overflow: hidden;
}

.embedded-panel {
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(231, 248, 241, 0.58), transparent 42%),
    rgba(255, 255, 255, 0.74);
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2 {
  color: var(--plum);
  font-size: 22px;
  line-height: 1.15;
}

.split-grid,
.stats-grid,
.course-grid,
.lecture-grid,
.material-grid,
.file-grid,
.game-layout {
  gap: 16px;
}

.course-card,
.lecture-card,
.material-card,
.list-row,
.access-card,
.message {
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.course-card:hover,
.lecture-card:hover,
.material-card:hover,
.list-row:hover,
.access-card:hover {
  border-color: rgba(22, 174, 134, 0.28);
  box-shadow: 0 18px 36px rgba(39, 25, 61, 0.09);
  transform: translateY(-2px);
}

.course-card-media {
  height: 170px;
  background: linear-gradient(135deg, #eef9f4, #f0edff);
}

.course-card-body {
  gap: 11px;
  padding: 18px;
}

.course-card h2 {
  font-size: 23px;
}

.course-card p {
  min-height: 58px;
}

.course-meta-row span,
.course-detail-meta span,
.badge,
.status {
  border-radius: 999px;
}

.course-meta-row span,
.course-detail-meta span {
  border-color: rgba(22, 174, 134, 0.15);
  background: rgba(231, 248, 241, 0.74);
}

.stat {
  padding: 17px;
}

.stat::after {
  display: none;
}

.stat strong {
  color: var(--plum);
  font-size: 30px;
}

input,
select,
textarea {
  min-height: 46px;
  border-color: rgba(87, 73, 127, 0.15);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.84) inset;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(118, 101, 240, 0.28);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(22, 174, 134, 0.72);
  box-shadow: 0 0 0 4px rgba(22, 174, 134, 0.12);
}

input[type="file"] {
  padding: 10px;
}

input[type="file"]::file-selector-button {
  min-height: 38px;
  margin-right: 12px;
  padding: 9px 12px;
  background: rgba(240, 237, 255, 0.94);
  color: var(--purple-strong);
}

.primary-button,
.ghost-button,
.danger-button,
.ghost-link-button {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-button {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 42%),
    linear-gradient(135deg, #20b98e, #087b61);
  box-shadow: 0 14px 24px rgba(8, 123, 97, 0.18);
}

.primary-button:hover {
  background: linear-gradient(135deg, #22af8a, #08755f);
  box-shadow: 0 16px 28px rgba(8, 123, 97, 0.22);
}

.ghost-button,
.ghost-link-button {
  border-color: rgba(118, 101, 240, 0.14);
  background: rgba(240, 237, 255, 0.82);
  color: var(--purple-strong);
}

.ghost-button:hover,
.ghost-link-button:hover {
  border-color: rgba(22, 174, 134, 0.22);
  background: rgba(231, 248, 241, 0.90);
  color: var(--green-strong);
}

.danger-button {
  background: #b94660;
}

.danger-button:hover {
  background: #9c324c;
}

.badge {
  border-color: rgba(22, 174, 134, 0.16);
  background: rgba(231, 248, 241, 0.90);
}

.muted-badge {
  border-color: rgba(118, 101, 240, 0.14);
  background: rgba(240, 237, 255, 0.86);
}

.status.pending,
.status.open,
.status.started,
.status.uploaded,
.status.processing {
  background: #fff6e6;
}

.status.assigned,
.status.replied,
.status.answered {
  background: rgba(240, 237, 255, 0.94);
}

.status.closed,
.status.submitted,
.status.ready,
.status.success {
  background: rgba(231, 248, 241, 0.94);
}

.check-mode-card {
  border-color: rgba(87, 73, 127, 0.13);
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.check-mode-card:has(input:checked) {
  border-color: rgba(22, 174, 134, 0.38);
  background:
    linear-gradient(135deg, rgba(231, 248, 241, 0.64), transparent 58%),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(8, 123, 97, 0.08);
}

.ai-mode-card {
  background:
    linear-gradient(135deg, rgba(231, 248, 241, 0.56), transparent 56%),
    rgba(255, 255, 255, 0.82);
}

.table-wrap {
  background: rgba(255, 255, 255, 0.92);
}

th,
td {
  padding: 12px 12px;
}

th {
  background: rgba(240, 237, 255, 0.62);
  color: var(--plum);
}

tbody tr:hover {
  background: rgba(231, 248, 241, 0.38);
}

.list-row {
  background:
    linear-gradient(135deg, rgba(236, 249, 253, 0.42), transparent 50%),
    rgba(255, 255, 255, 0.88);
}

.message,
.chat-message {
  background: rgba(255, 255, 255, 0.90);
}

.chat-message.own-message {
  border-color: rgba(22, 174, 134, 0.22);
  background:
    linear-gradient(135deg, rgba(231, 248, 241, 0.55), transparent 56%),
    rgba(255, 255, 255, 0.92);
}

.attachment-pill {
  background: rgba(240, 237, 255, 0.78);
}

.material-card {
  background:
    linear-gradient(135deg, rgba(236, 249, 253, 0.62), transparent 48%),
    rgba(255, 255, 255, 0.90);
}

.lecture-card {
  min-height: 142px;
  background: rgba(255, 255, 255, 0.90);
}

.media-state {
  color: var(--green-strong);
}

.secure-video-shell,
.video-shell {
  background: #151020;
  box-shadow: 0 18px 42px rgba(26, 17, 41, 0.16);
}

.secure-pdf-shell {
  background: #fbfcff;
  box-shadow: 0 18px 42px rgba(39, 25, 61, 0.08);
}

.pdf-toolbar {
  background: rgba(255, 255, 255, 0.96);
}

.pdf-pager-button {
  background: rgba(240, 237, 255, 0.92);
}

.pdf-pager-button:hover:not(:disabled) {
  background: rgba(231, 248, 241, 0.92);
}

.pdf-canvas-page,
.pdf-image-page img {
  box-shadow: 0 18px 42px rgba(39, 25, 61, 0.09);
}

.game-stage {
  background: rgba(255, 255, 255, 0.92);
}

.game-hud > div:not(.game-timer),
.math-hud > div,
.word-hud > div {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(39, 25, 61, 0.07);
}

.game-controls {
  background: rgba(255, 255, 255, 0.92);
}

.puzzle-game,
.tetris-game,
.math-game {
  background:
    linear-gradient(135deg, rgba(240, 237, 255, 0.70), rgba(231, 248, 241, 0.68)),
    #ffffff;
}

.word-game {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 252, 0.96));
}

.word-cell {
  font-size: 36px;
}

.tile-2048 {
  font-size: 34px;
}

.game-overlay strong {
  font-size: 52px;
}

.mobile-menu-panel {
  border-color: rgba(87, 73, 127, 0.12);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 42px rgba(39, 25, 61, 0.14);
}

.mobile-nav a:hover {
  background: rgba(231, 248, 241, 0.82);
}

.moved-layout {
  min-height: calc(100vh - 150px);
  display: grid;
  place-items: center;
  padding: 34px 0;
}

.moved-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 860px);
  padding: 42px;
  border: 1px solid rgba(87, 73, 127, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.88) 52%, rgba(231, 248, 241, 0.70) 100%),
    url("/static/assets/ksigma-hero-bg.png") right center / cover no-repeat;
  box-shadow: 0 20px 48px rgba(39, 25, 61, 0.10);
}

.moved-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #13ad83, #4e91c2 48%, #7665f0);
}

.moved-card::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: -36px;
  width: 190px;
  aspect-ratio: 1;
  background: url("/static/assets/ksigma-anteater.png") bottom right / contain no-repeat;
  opacity: 0.20;
  pointer-events: none;
}

.moved-card > * {
  position: relative;
  z-index: 1;
}

.moved-card h1 {
  max-width: 650px;
  margin: 0;
  color: var(--plum);
  font-size: 48px;
  line-height: 1.04;
  letter-spacing: 0;
}

.moved-card p:not(.eyebrow) {
  max-width: 660px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.moved-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

@media (max-width: 980px) {
  .topbar {
    min-height: 58px;
    padding: 9px 12px;
  }

  .page {
    width: min(100% - 24px, 1240px);
    margin-top: 18px;
  }

  .page-header {
    min-height: 120px;
    padding: 24px;
  }

  .auth-copy h1,
  .page-header h1,
  .catalog-hero h1,
  .course-detail-copy h1 {
    font-size: 38px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .page {
    width: min(100% - 18px, 1240px);
    margin-top: 14px;
  }

  .page-header,
  .auth-copy,
  .catalog-hero,
  .course-detail-hero {
    padding: 20px;
  }

  .page-header {
    min-height: 0;
    align-items: flex-start;
  }

  .page-header::after,
  .auth-copy::after {
    opacity: 0.10;
  }

  .auth-copy h1,
  .page-header h1,
  .catalog-hero h1,
  .course-detail-copy h1 {
    font-size: 32px;
    line-height: 1.08;
  }

  .auth-copy p,
  .catalog-hero p,
  .course-detail-copy p {
    font-size: 15px;
  }

  .auth-panel,
  .panel,
  .embedded-panel {
    padding: 16px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .course-card-media {
    height: 148px;
  }

  .course-card h2,
  .panel-heading h2 {
    font-size: 20px;
  }

  .list-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .meta-list div {
    grid-template-columns: 1fr;
  }

  .word-cell {
    font-size: 30px;
  }

  .tile-2048 {
    font-size: 26px;
  }

  .game-overlay strong {
    font-size: 38px;
  }

  .moved-layout {
    min-height: calc(100vh - 104px);
    padding: 14px 0;
  }

  .moved-card {
    padding: 24px 20px;
  }

  .moved-card::after {
    width: 130px;
    opacity: 0.12;
  }

  .moved-card h1 {
    font-size: 34px;
  }

  .moved-card p:not(.eyebrow) {
    font-size: 15px;
  }

  .moved-actions {
    display: grid;
  }
}
