:root {
  /* Kahoot-подобный: фиолетовый фон, белые карточки */
  --bg: #46178f;
  --bg-deep: #381466;
  --surface: #ffffff;
  --surface2: #f0f2f8;
  --text: #ffffff;
  --text-on-card: #1a1d29;
  --muted: rgba(255, 255, 255, 0.72);
  --muted-on-card: #5c6470;
  --accent: #e21b3c;
  --accent-dim: #c41230;
  --accent-teal: #26890c;
  --accent-gold: #ffc800;
  --accent-violet: #864cbf;
  --ipa: #1368ce;
  --ok: #26890c;
  --err: #e21b3c;
  --radius: 14px;
  --font: 'Nunito', 'Nunito Sans', system-ui, sans-serif;
  --font-display: 'Nunito', var(--font);
  --card-shadow: 0 6px 0 rgba(0, 0, 0, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
  background: linear-gradient(165deg, var(--bg) 0%, var(--bg-deep) 55%, #2d0f52 100%);
  position: relative;
  overflow-x: clip;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(255, 255, 255, 0.12) 0%, transparent 55%);
}

a {
  color: var(--accent-gold);
}

.app-header {
  padding: max(0.85rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) 0.85rem
    max(1rem, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header__inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.logo span {
  color: var(--accent-gold);
}

.tagline {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem max(1.5rem, env(safe-area-inset-right, 0px)) calc(2.5rem + env(safe-area-inset-bottom, 0px))
    max(1.5rem, env(safe-area-inset-left, 0px));
}

.banner {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: rgba(255, 180, 80, 0.12);
  border: 1px solid rgba(255, 180, 80, 0.35);
  color: #ffd4a8;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.banner[hidden] {
  display: none !important;
}

.load-error {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid rgba(255, 92, 92, 0.35);
  color: #ffb4b4;
  margin-bottom: 1rem;
}

.load-error[hidden] {
  display: none !important;
}

.stats-pill {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
}

.learning-path-card {
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-on-card);
  box-shadow: var(--card-shadow);
}

.learning-path-card[hidden] {
  display: none !important;
}

.learning-path-card__title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  margin: 0 0 0.65rem;
  color: var(--text-on-card);
}

.learning-path-track {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.15rem 0;
}

.learning-path-branch {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted-on-card);
  margin: 0.55rem 0 0.1rem;
  letter-spacing: 0.03em;
}

.lesson-node {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.25rem 0;
}

.lesson-node__circle {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #d8dde8;
  background: var(--surface2);
  font-size: 0.95rem;
}

.lesson-node--locked .lesson-node__circle {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.lesson-node--available .lesson-node__circle {
  border-color: var(--ipa);
  background: #fff;
}

.lesson-node--current .lesson-node__circle {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(134, 76, 191, 0.25);
  background: #fff;
}

.lesson-node--done .lesson-node__circle {
  border-color: #e6a800;
  background: linear-gradient(160deg, #fff9e0, #ffe082);
}

.lesson-node--cracked .lesson-node__circle {
  border-color: #b8860b;
  background: linear-gradient(160deg, #f5e6c8, #e8c96a);
}

.lesson-node__glyph--crack {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #8b4513;
  color: #a67c00;
}

.lesson-node__body {
  flex: 1;
  min-width: 0;
}

.lesson-node__theme {
  font-size: 0.72rem;
  color: var(--muted-on-card);
  line-height: 1.2;
}

.lesson-node__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-on-card);
  line-height: 1.25;
}

.lesson-node__meta {
  font-size: 0.78rem;
  color: var(--muted-on-card);
  margin-top: 0.1rem;
}

.learning-path-card__hint {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--muted-on-card);
}

.progress-panel {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-on-card);
  border: none;
  box-shadow: var(--card-shadow);
}

.progress-panel__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  color: var(--text-on-card);
}

.progress-panel__list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted-on-card);
  font-size: 0.92rem;
}

.progress-panel__list li + li {
  margin-top: 0.35rem;
}

.progress-panel__cats {
  margin-top: 1rem;
}

.progress-panel__subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted-on-card);
}

.progress-panel__hint {
  margin: 0;
  border: none;
  padding: 0;
}

.prog-cat-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-on-card);
}

.prog-cat-list li + li {
  margin-top: 0.25rem;
}

.progress-panel__difficult {
  margin-top: 1rem;
}

.round-result-extra {
  margin-top: 0.35rem;
  border: none;
  padding: 0;
}

.hero {
  margin-bottom: 2rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: #fff;
}

.hero p {
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
  max-width: 52ch;
}

.cards {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  text-align: left;
  padding: 1.35rem 1.25rem;
  min-height: 5.5rem;
  border-radius: var(--radius);
  background: #fff;
  border: none;
  color: var(--text-on-card);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.2);
}

.card:active {
  transform: translateY(0);
}

.card__icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.card__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.card__desc {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--muted-on-card);
}

.panel {
  border-radius: calc(var(--radius) + 2px);
  background: #fff;
  color: var(--text-on-card);
  border: none;
  padding: 1.5rem 1.5rem 1.35rem;
  box-shadow: var(--card-shadow);
}

.panel__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  color: var(--muted-on-card);
  font: inherit;
  cursor: pointer;
}

.panel__back:hover {
  color: var(--text-on-card);
  border-color: rgba(0, 0, 0, 0.12);
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  margin: 0 0 1rem;
  color: var(--text-on-card);
}

.panel .btn--ghost {
  background: var(--surface2);
  color: var(--text-on-card);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.panel .btn--ghost:hover:not(:disabled) {
  background: #e4e8ef;
}

.panel .form__label {
  color: var(--muted-on-card);
}

.panel .form input,
.panel .teacher-input,
.panel .teacher-select {
  background: #fff;
  color: var(--text-on-card);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.panel .form__status--ok {
  color: #0d5c26;
  background: rgba(38, 137, 12, 0.12);
  border-color: rgba(38, 137, 12, 0.35);
}

.panel .form__status--err {
  color: #8b1530;
  background: rgba(226, 27, 60, 0.08);
  border-color: rgba(226, 27, 60, 0.35);
}

.panel .form__status--muted {
  color: var(--muted-on-card);
  border-color: rgba(0, 0, 0, 0.08);
}

.panel .status {
  background: var(--surface2);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-on-card);
}

.panel .status--ok {
  color: #0d5c26;
  background: rgba(38, 137, 12, 0.12);
  border-color: rgba(38, 137, 12, 0.35);
}

.panel .status--err {
  color: #8b1530;
  background: rgba(226, 27, 60, 0.08);
  border-color: rgba(226, 27, 60, 0.35);
}

.panel .status--muted {
  color: var(--muted-on-card);
}

.panel .choice {
  background: #fff;
  color: var(--text-on-card);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.panel .choice:hover:not(:disabled) {
  border-color: var(--ipa);
}

.panel .data-table th,
.panel .data-table td {
  color: var(--text-on-card);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.panel .data-table th {
  color: var(--muted-on-card);
}

.panel .table-wrap {
  border-color: rgba(0, 0, 0, 0.08);
}

.panel .teacher-tabs__btn {
  background: var(--surface2);
  color: var(--muted-on-card);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.panel .teacher-tabs__btn:hover {
  color: var(--text-on-card);
  border-color: rgba(19, 104, 206, 0.35);
}

.panel .teacher-tabs__btn.is-active {
  background: #fff;
  border-color: var(--accent);
  color: var(--text-on-card);
  box-shadow: 0 2px 0 rgba(226, 27, 60, 0.35);
}

.panel .teacher-room-word-pick__list {
  background: var(--surface2);
  border-color: rgba(0, 0, 0, 0.08);
}

.panel .teacher-room-word-pick__row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.panel .room-level-cards li {
  background: var(--surface2);
  border-color: rgba(0, 0, 0, 0.08);
}

.panel .room-level-cards .room-level-cards__meta {
  color: var(--muted-on-card);
}

.panel .table-block-title {
  color: var(--text-on-card);
}

.panel .result-mode {
  color: var(--muted-on-card);
}

.panel .linklike {
  color: var(--ipa);
}

.panel .linklike:hover {
  color: #0d4d9e;
}

.panel .session-summary {
  background: var(--surface2);
  border-color: rgba(0, 0, 0, 0.08);
}

.panel .session-summary__line {
  color: var(--text-on-card);
}

.panel .session-summary__rec {
  color: var(--ipa);
}

.panel .teacher-cat-row {
  background: var(--surface2);
  border-color: rgba(0, 0, 0, 0.08);
}

.panel .teacher-cat-row__toggle {
  color: var(--text-on-card);
}

.panel .teacher-auth-legacy {
  background: var(--surface2);
  border-color: rgba(0, 0, 0, 0.08);
}

.panel .room-share__url {
  color: var(--text-on-card);
  word-break: break-all;
}

.panel .room-leaderboard__item {
  border-color: rgba(0, 0, 0, 0.06);
}

.panel .room-leaderboard__name,
.panel .room-leaderboard__pts {
  color: var(--text-on-card);
}

.panel .teacher-room-levels li {
  border-color: rgba(0, 0, 0, 0.06);
}

.panel .room-share__qr img {
  border-color: rgba(0, 0, 0, 0.08);
}

.panel .teacher-room-setting {
  background: var(--surface2);
  border-color: rgba(0, 0, 0, 0.08);
}

.panel .student-room-pick {
  background: var(--surface2);
  border-color: rgba(19, 104, 206, 0.22);
}

.panel .teacher-auth-legacy__summary {
  color: var(--text-on-card);
}

.panel .teacher-auth-legacy__summary:hover {
  color: var(--ipa);
}

.category-badge {
  margin: -0.35rem 0 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted-on-card);
  background: rgba(134, 76, 191, 0.12);
  border: 1px solid rgba(134, 76, 191, 0.25);
  max-width: 100%;
}

.category-badge[hidden] {
  display: none !important;
}

.round-progress {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-on-card);
}

.verdict {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--surface2);
}

.verdict[hidden] {
  display: none !important;
}

.verdict__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.verdict--ok .verdict__icon {
  background: rgba(78, 204, 163, 0.22);
  color: var(--accent-teal);
}

.verdict--err .verdict__icon {
  background: rgba(255, 92, 92, 0.2);
  color: #ff8a8a;
}

.verdict__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.verdict__stars {
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  color: #ffc14d;
  line-height: 1.2;
}

.verdict--partial {
  border-color: rgba(255, 193, 77, 0.45);
  background: rgba(255, 193, 77, 0.08);
}

.verdict--partial .verdict__text {
  color: #8a5a00;
}

.verdict__text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-on-card);
}

.verdict__sub {
  font-size: 0.92rem;
  color: var(--muted-on-card);
  line-height: 1.4;
}

.verdict--ok {
  border-color: rgba(78, 204, 163, 0.45);
  background: rgba(78, 204, 163, 0.1);
}

.verdict--err {
  border-color: rgba(255, 92, 92, 0.35);
  background: rgba(255, 92, 92, 0.06);
}

.choice--large {
  font-size: 1.05rem;
  padding: 1rem 1.15rem;
}

.panel--result {
  text-align: center;
}

.panel--result .actions {
  justify-content: center;
}

.result-mode {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 1rem;
}

.result-score {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 800;
  color: var(--accent-gold);
}

.target-box {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  background: #e8e4f4;
  border: 2px dashed rgba(70, 23, 143, 0.25);
  margin-bottom: 1rem;
}

.target-box__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-on-card);
  margin: 0 0 0.35rem;
}

.target-box__word {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-on-card);
}

.ipa {
  font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', sans-serif;
  font-size: 1.15rem;
  color: var(--ipa);
  margin: 0.5rem 0 0;
}

.hint {
  font-size: 0.95rem;
  color: var(--muted-on-card);
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.transcript-label {
  font-size: 0.8rem;
  color: var(--muted-on-card);
  margin: 1rem 0 0.25rem;
}

.transcript {
  font-size: 1.05rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  min-height: 2.75rem;
  color: var(--text-on-card);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  border: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 0.15s ease,
    opacity 0.15s ease,
    transform 0.15s ease,
    filter 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #fff;
  font-weight: 800;
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status--ok {
  background: rgba(78, 204, 163, 0.12);
  border-color: rgba(78, 204, 163, 0.38);
  color: #b8f5e8;
}

.status--err {
  background: rgba(255, 92, 92, 0.1);
  border-color: rgba(255, 92, 92, 0.35);
  color: #ffc8c8;
}

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

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.choice {
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', sans-serif;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice:hover:not(:disabled) {
  border-color: rgba(61, 156, 245, 0.45);
}

.choice:disabled {
  cursor: default;
}

.choice--correct {
  border-color: rgba(52, 199, 89, 0.6);
  background: rgba(52, 199, 89, 0.12);
}

.choice--wrong {
  border-color: rgba(255, 92, 92, 0.55);
  background: rgba(255, 92, 92, 0.1);
}

.footer-note {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-user__label {
  font-size: 0.9rem;
  color: var(--muted);
}

.btn--sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.panel--narrow {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  margin: 0 0 0.75rem;
}

.role-cards {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (min-width: 520px) {
  .role-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.role-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--surface2);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.role-card:hover {
  border-color: rgba(61, 156, 245, 0.45);
  transform: translateY(-2px);
}

.role-card__icon {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.role-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}

.role-card__desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.form {
  margin-top: 1rem;
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form__label {
  font-size: 0.88rem;
  color: var(--muted);
}

.form input {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
}

.form__actions {
  margin-top: 0.5rem;
}

.form__status {
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
}

.form__status--ok {
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.35);
  color: #b8f5c8;
}

.form__status--err {
  background: rgba(255, 92, 92, 0.1);
  border: 1px solid rgba(255, 92, 92, 0.35);
  color: #ffc8c8;
}

.form__status--muted {
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.teacher-panel__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}

.teacher-panel__head h2.teacher-panel__title {
  margin: 0;
  font-size: 1.22rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-panel__actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.teacher-panel__actions .btn {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
}

.table-block-title {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.teacher-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1rem 0 1.25rem;
}

.teacher-tabs__btn {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  cursor: pointer;
}

.teacher-tabs__btn:hover {
  color: var(--text);
  border-color: rgba(61, 156, 245, 0.35);
}

.teacher-tabs__btn.is-active {
  background: rgba(61, 156, 245, 0.2);
  border-color: rgba(61, 156, 245, 0.45);
  color: var(--text);
}

/* Нижняя панель вкладок (только мобильный кабинет учителя) */
.teacher-tabbar {
  display: none;
}

.student-room-tabbar {
  display: none;
}

.teacher-pane__hint {
  margin-top: 0;
  margin-bottom: 1rem;
}

.teacher-toolbar {
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.teacher-toolbar__label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 280px;
}

.teacher-input,
.teacher-select {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
}

.teacher-input--textarea {
  resize: vertical;
  min-height: 4rem;
}

.teacher-curriculum-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.teacher-cat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.teacher-cat-row__toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.92rem;
  flex: 1;
  min-width: 12rem;
}

.teacher-cat-row__toggle input {
  margin-top: 0.2rem;
}

.teacher-cat-row__actions {
  display: flex;
  gap: 0.25rem;
}

.teacher-cat-code {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: normal;
}

.btn--small {
  font-size: 0.8rem;
  padding: 0.35rem 0.55rem;
  min-height: auto;
}

.linklike {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-align: left;
}

.linklike:hover {
  color: var(--accent-dim);
}

.session-summary {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.session-summary__line {
  margin: 0.35rem 0;
  color: var(--text);
}

.session-summary__rec {
  margin: 0.75rem 0 0;
  font-weight: 600;
  color: var(--accent);
}

.teacher-detail-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
}

.teacher-detail-list li {
  margin: 0.35rem 0;
}

.room-share {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
  margin: 1rem 0;
}

.room-share__url {
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
  word-break: break-all;
  margin: 0.35rem 0 0.5rem;
  color: var(--text);
}

.room-share__qr img {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #fff;
}

.teacher-room-levels {
  list-style: none;
  margin: 0;
  padding: 0;
}

.teacher-room-levels li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.teacher-room-word-pick__intro {
  margin: 0 0 0.65rem;
  border: none;
  padding: 0;
  font-size: 0.9rem;
}

.teacher-room-word-pick__filter {
  margin-bottom: 0.5rem !important;
}

.teacher-room-word-pick__list {
  max-height: 16rem;
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.35rem 0.25rem;
}

.teacher-room-word-pick__row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  margin-bottom: 0.15rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.35;
}

.teacher-room-word-pick__row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.teacher-room-word-pick__row input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

.teacher-room-word-pick__line {
  flex: 1;
  min-width: 0;
}

.teacher-room-word-pick__line strong {
  font-weight: 700;
}

.room-level-cards {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.room-level-cards li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.room-level-cards .room-level-cards__meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.repeat-panel--room {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: min(72vh, 40rem);
}

.repeat-game-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ede7f7 0%, #e4ecfa 100%);
  border: 1px solid rgba(70, 23, 143, 0.12);
}

.repeat-game-hud__track {
  flex: 1;
  min-width: 12rem;
}

.repeat-game-hud__bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.repeat-game-hud__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted-on-card);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.repeat-game-hud__pct {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-on-card);
}

.repeat-game-hud__bar {
  height: 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.repeat-game-hud__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent));
  transition: width 0.35s ease;
}

.repeat-game-hud__score {
  text-align: right;
  min-width: 5rem;
}

.repeat-game-hud__score-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted-on-card);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.repeat-game-hud__score-value {
  font-size: 1.85rem;
  font-weight: 900;
  font-family: var(--font-display);
  color: var(--accent);
  line-height: 1.1;
}

.repeat-room-points-hint {
  margin-top: 0.5rem;
  font-size: 0.86rem;
}

.repeat-actions--room-mic {
  margin-top: auto;
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.repeat-actions--room-mic #btn-repeat-speak {
  order: -1;
  width: min(6.25rem, 22vw);
  height: min(6.25rem, 22vw);
  min-height: unset;
  padding: 0;
  margin: 0 auto;
  font-size: 1.85rem;
  line-height: 1;
  font-weight: 800;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  box-shadow: 0 8px 32px rgba(233, 69, 96, 0.42);
}

.repeat-actions--room-mic #btn-repeat-speak:hover:not(:disabled) {
  transform: scale(1.05);
  filter: brightness(1.05);
}

.repeat-actions--room-mic #btn-repeat-hear,
.repeat-actions--room-mic #btn-repeat-next {
  align-self: center;
}

.repeat-panel--room .target-box {
  text-align: center;
  padding: 1.75rem 1.5rem 1.5rem;
  border: 2px dashed rgba(70, 23, 143, 0.2);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(19, 104, 206, 0.08);
}

.repeat-panel--room .target-box__label {
  font-weight: 800;
  letter-spacing: 0.1em;
}

.repeat-panel--room .target-box__word {
  font-weight: 900;
  font-size: clamp(2rem, 7vw, 3.25rem);
}

.room-level-result {
  position: relative;
  overflow: hidden;
}

.room-level-result__burst {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 20%, rgba(245, 166, 35, 0.28), transparent 45%),
    radial-gradient(circle at 70% 80%, rgba(168, 85, 247, 0.22), transparent 40%);
  pointer-events: none;
  opacity: 0;
}

.room-level-result--animate .room-level-result__burst {
  animation: room-burst-in 0.9s ease-out forwards;
}

.room-level-result__title {
  position: relative;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  margin-bottom: 0.5rem;
  transform: translateY(12px);
  opacity: 0;
  color: var(--text-on-card);
}

.room-level-result--animate .room-level-result__title {
  animation: room-pop-in 0.55s ease-out 0.08s forwards;
}

.room-level-result__points {
  position: relative;
  font-size: clamp(2rem, 8vw, 3.25rem);
  font-weight: 900;
  font-family: var(--font-display);
  margin: 0.25rem 0 0.5rem;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: scale(0.92);
  opacity: 0;
}

.room-level-result--animate .room-level-result__points {
  animation: room-score-pop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s forwards;
}

.room-level-result__sub {
  position: relative;
  margin-bottom: 1rem;
  opacity: 0;
  color: var(--muted-on-card);
}

.room-level-result--animate .room-level-result__sub {
  animation: room-fade-up 0.5s ease-out 0.35s forwards;
}

.room-level-result__lb-title,
.room-level-result__lb-hint {
  position: relative;
  opacity: 0;
}

.room-level-result--animate .room-level-result__lb-title {
  animation: room-fade-up 0.45s ease-out 0.45s forwards;
}

.room-level-result--animate .room-level-result__lb-hint {
  animation: room-fade-up 0.45s ease-out 0.52s forwards;
}

.room-leaderboard {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  position: relative;
}

.room-leaderboard__item {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.35rem;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateX(-8px);
}

.room-level-result--animate .room-leaderboard__item {
  animation: room-row-in 0.4s ease-out forwards;
}

.room-level-result--animate .room-leaderboard__item:nth-child(1) {
  animation-delay: 0.55s;
}
.room-level-result--animate .room-leaderboard__item:nth-child(2) {
  animation-delay: 0.62s;
}
.room-level-result--animate .room-leaderboard__item:nth-child(3) {
  animation-delay: 0.69s;
}
.room-level-result--animate .room-leaderboard__item:nth-child(4) {
  animation-delay: 0.76s;
}
.room-level-result--animate .room-leaderboard__item:nth-child(5) {
  animation-delay: 0.83s;
}
.room-level-result--animate .room-leaderboard__item:nth-child(n + 6) {
  animation-delay: 0.9s;
}

.room-leaderboard__item:nth-child(1) {
  border-color: rgba(245, 166, 35, 0.55);
  background: rgba(245, 166, 35, 0.08);
}

.room-leaderboard__item:nth-child(2) {
  border-color: rgba(148, 163, 184, 0.35);
}

.room-leaderboard__item:nth-child(3) {
  border-color: rgba(205, 127, 50, 0.45);
}

.room-leaderboard__item--you {
  border-color: rgba(233, 69, 96, 0.45);
  background: rgba(233, 69, 96, 0.1);
}

.room-leaderboard__rank {
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--accent-gold);
  text-align: center;
}

.room-leaderboard__name {
  font-weight: 600;
}

.room-leaderboard__pts {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.9rem;
}

.room-leaderboard__you {
  font-weight: 700;
  color: var(--accent-teal);
}

@keyframes room-burst-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes room-pop-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes room-score-pop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes room-fade-up {
  to {
    opacity: 1;
  }
}

@keyframes room-row-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Главный экран: сценарий «игра в классе» (PIN / учитель) */
.gamehub {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  text-align: center;
}

.gamehub__brand {
  margin-bottom: 1.75rem;
}

.gamehub__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.15rem, 6vw, 3rem);
  letter-spacing: -0.04em;
  margin: 0 0 0.5rem;
  line-height: 1.12;
  color: #fff;
}

.gamehub__tagline {
  margin: 0 auto 0.25rem;
  max-width: 22rem;
  padding: 0 1rem;
  font-family: var(--font);
  font-size: clamp(0.92rem, 3.6vw, 1.08rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.88);
  text-wrap: balance;
}

@supports not (text-wrap: balance) {
  .gamehub__tagline {
    max-width: 19rem;
  }
}

@media (max-width: 380px) {
  .gamehub__tagline {
    max-width: 100%;
    padding: 0 0.5rem;
    font-size: 0.95rem;
  }
}

.gamehub__subtitle {
  margin: 0 auto;
  max-width: 34rem;
  font-size: 1.02rem;
  color: var(--muted);
  line-height: 1.45;
}

.gamehub__choices {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .gamehub__choices {
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
  }
}

.gamehub-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: 1.5rem 1.35rem 1.35rem;
  border-radius: var(--radius);
  border: none;
  background: #fff;
  color: var(--text-on-card);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.gamehub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.22);
}

.gamehub-card:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 3px;
}

.gamehub-card--join {
  box-shadow: 0 6px 0 #1368ce;
}

.gamehub-card--host {
  box-shadow: 0 6px 0 #e21b3c;
}

.gamehub-card__k {
  font-size: 1.65rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  opacity: 0.85;
  color: var(--muted-on-card);
}

.gamehub-card__t {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.gamehub-card__d {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.35;
}

.gamehub__footer {
  margin-top: 1.85rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

.gamehub__sep {
  margin: 0 0.4rem;
  opacity: 0.45;
}

.gamehub__note {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .gamehub__note {
    display: block;
    margin-top: 0.35rem;
  }
}

.student-room-join-code-wrap[hidden] {
  display: none !important;
}

/* Вход в комнату: полноэкранно, в духе Kahoot (в т.ч. ?room=) */
.student-room-join-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 2rem;
  box-sizing: border-box;
  background: linear-gradient(165deg, #46178f 0%, #381466 50%, #2d0f52 100%);
}

.student-room-join-back {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: var(--font);
}

.student-room-join-back:hover {
  background: rgba(255, 255, 255, 0.24);
}

.student-room-join-content {
  width: 100%;
  max-width: 22rem;
  text-align: center;
  color: #fff;
}

.student-room-join-code-big {
  margin: 0 0 1.1rem;
}

.student-room-join-code-big__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.88;
  margin-bottom: 0.4rem;
}

.student-room-join-code-big__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 10vw, 3.5rem);
  letter-spacing: 0.06em;
  line-height: 1;
  color: #ffc800;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.35);
}

.student-room-join-heading {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.65rem, 5vw, 2.1rem);
  letter-spacing: -0.02em;
  color: #fff;
}

.student-room-join-view--from-link .student-room-join-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.student-room-join-form[hidden] {
  display: none !important;
}

.student-room-join-subtitle {
  margin: 0 0 1.35rem;
  font-family: var(--font-display);
  font-size: clamp(1rem, 3.4vw, 1.25rem);
  font-weight: 700;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.95);
  min-height: 1.35em;
}

.student-room-join-status {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.3;
}

.student-room-join-status--closed {
  background: rgba(0, 0, 0, 0.28);
  border: 3px solid #ffc800;
  color: #fff8d6;
}

.student-room-join-status--err {
  background: rgba(226, 27, 60, 0.35);
  border: 2px solid #ff8a9a;
  color: #fff;
}

.student-room-join-status--ok {
  background: rgba(38, 137, 12, 0.35);
  border: 2px solid #9ae6a8;
  color: #f0fff0;
}

.student-room-join-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  text-align: left;
}

.student-room-join-field__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 0.4rem;
  color: rgba(255, 255, 255, 0.92);
}

.student-room-join-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 1.12rem;
  font-weight: 700;
  color: #1a1d29;
  background: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
  user-select: text;
  -webkit-user-select: text;
}

.student-room-join-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.student-room-join-input::placeholder {
  color: #8b939e;
  font-weight: 600;
}

.student-room-join-input:focus {
  outline: 3px solid #ffc800;
  outline-offset: 2px;
}

.student-room-join-submit.btn--primary {
  width: 100%;
  margin-top: 0.15rem;
  padding: 1.05rem 1.2rem;
  font-size: 1.22rem;
  font-weight: 900;
  border-radius: 8px;
  box-shadow: 0 6px 0 #9a0f24;
  border: none;
}

.student-room-join-submit.btn--primary:hover:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 4px 0 #9a0f24;
  filter: brightness(1.03);
}

.student-room-join-submit.btn--primary:disabled {
  opacity: 0.45;
  box-shadow: none;
  transform: none;
}

.teacher-auth-legacy {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem 0.85rem;
  background: rgba(0, 0, 0, 0.12);
}

.teacher-auth-legacy__summary {
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--muted);
  user-select: none;
}

.teacher-auth-legacy__summary:hover {
  color: var(--text);
}

.teacher-room-setting {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
}

.teacher-room-setting__label {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0;
}

.teacher-room-setting__label input {
  margin-top: 0.22rem;
  flex-shrink: 0;
}

.student-room-pick {
  margin-bottom: 1.25rem;
  padding: 1rem 1rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(61, 156, 245, 0.28);
  background: rgba(30, 58, 95, 0.2);
}

.student-room-pick .teacher-input {
  width: 100%;
  max-width: 100%;
}

/* ——— Мобильные экраны: safe-area, касания, плотность ——— */
.gamehub-card,
.card,
.choice {
  touch-action: manipulation;
}

@media (max-width: 640px) {
  body {
    font-size: 1rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  main {
    padding-top: 1rem;
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    padding-bottom: calc(1.75rem + env(safe-area-inset-bottom, 0px));
  }

  .panel {
    padding: 1.1rem max(1rem, env(safe-area-inset-right, 0px)) 1.05rem max(1rem, env(safe-area-inset-left, 0px));
    border-radius: 12px;
  }

  .panel--narrow {
    max-width: 100%;
  }

  .panel h2 {
    font-size: 1.2rem;
  }

  .panel__back {
    min-height: 44px;
    padding: 0.5rem 0.9rem;
  }

  .btn {
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
  }

  .btn--sm {
    min-height: 2.4rem;
  }

  .actions:not(.teacher-panel__actions) {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .actions:not(.teacher-panel__actions) .btn {
    width: 100%;
    justify-content: center;
  }

  .teacher-panel__head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem 0.5rem;
    position: sticky;
    z-index: 12;
    top: calc(3.25rem + env(safe-area-inset-top, 0px));
    margin-left: -0.35rem;
    margin-right: -0.35rem;
    padding: 0.4rem 0.35rem 0.5rem;
    margin-top: -0.15rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.94) 85%, rgba(255, 255, 255, 0));
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .teacher-panel__title {
    font-size: 1.1rem;
  }

  .teacher-panel__actions {
    flex-shrink: 0;
    gap: 0.3rem;
  }

  .teacher-panel__actions .btn,
  .teacher-panel__actions .btn.btn--sm {
    min-height: 2.25rem;
    padding: 0.38rem 0.55rem;
    font-size: 0.78rem;
    width: auto;
    min-width: unset;
  }

  [data-view='teacher-panel'] > .panel {
    padding-bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
  }

  [data-view='teacher-panel'] .teacher-tabs {
    display: none;
  }

  .teacher-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    justify-content: space-around;
    align-items: stretch;
    margin: 0;
    padding: 0.3rem 0 max(0.45rem, env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.08);
  }

  .teacher-tabbar__btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    min-width: 0;
    min-height: 3.25rem;
    padding: 0.25rem 0.2rem 0.35rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted-on-card);
    font-family: var(--font);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .teacher-tabbar__icon {
    display: block;
    font-size: 1.38rem;
    line-height: 1;
    opacity: 0.82;
    transition: transform 0.12s ease, opacity 0.12s ease;
  }

  .teacher-tabbar__label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .teacher-tabbar__btn.is-active {
    color: var(--ipa);
    background: rgba(19, 104, 206, 0.08);
  }

  .teacher-tabbar__btn.is-active .teacher-tabbar__icon {
    opacity: 1;
    transform: scale(1.06);
  }

  .teacher-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .teacher-toolbar__label {
    max-width: none;
    width: 100%;
  }

  .teacher-input,
  .teacher-select {
    min-height: 2.75rem;
    font-size: 16px;
  }

  .panel .form input,
  .panel .form textarea {
    font-size: 16px;
  }

  .table-wrap {
    border-radius: 8px;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem 0.55rem;
    font-size: 0.82rem;
  }

  .cards {
    gap: 0.75rem;
  }

  .card {
    min-height: 4.5rem;
    padding: 1.1rem 1rem;
  }

  .choice {
    min-height: 3rem;
    padding: 0.95rem 1rem;
  }

  .gamehub {
    padding: max(1.25rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
      max(2rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  }

  .gamehub__brand {
    margin-bottom: 1.35rem;
  }

  .gamehub-card {
    min-height: 4.25rem;
    padding: 1.2rem 1.1rem;
  }

  .room-level-cards li {
    flex-direction: column;
    align-items: stretch;
  }

  .room-level-cards li .btn {
    width: 100%;
  }

  .student-room-join-backdrop {
    padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
      max(1.5rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  }

  .student-room-join-back {
    top: max(0.75rem, env(safe-area-inset-top, 0px));
    left: max(0.75rem, env(safe-area-inset-left, 0px));
  }

  .student-room-join-input {
    min-height: 2.85rem;
    font-size: 16px;
  }

  .student-room-join-submit.btn--primary {
    min-height: 3rem;
  }

  .repeat-actions--room-mic #btn-repeat-hear,
  .repeat-actions--room-mic #btn-repeat-next {
    width: 100%;
    max-width: 16rem;
  }

  /* Лобби ученика: нижняя панель без прокрутки к «Выйти» */
  .student-room-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 24;
    justify-content: space-around;
    align-items: stretch;
    margin: 0;
    padding: 0.28rem 0 max(0.42rem, env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.08);
  }

  .student-room-lobby-panel__leave-wide {
    display: none;
  }

  .student-room-lobby-panel {
    padding-bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px));
  }

  .student-room-tabbar__btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-width: 0;
    min-height: 3.1rem;
    padding: 0.25rem 0.2rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted-on-card);
    font-family: var(--font);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .student-room-tabbar__icon {
    font-size: 1.28rem;
    line-height: 1;
  }

  .student-room-tabbar__label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .student-room-tabbar__btn--danger {
    color: var(--accent);
  }

  /* Урок в комнате: «Говорю» и кнопки всегда снизу экрана */
  #repeat-panel.repeat-panel--room {
    min-height: auto;
    padding-bottom: calc(10.75rem + env(safe-area-inset-bottom, 0px));
  }

  #repeat-panel.repeat-panel--room #repeat-actions.repeat-actions--room-mic {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 24;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0.45rem max(0.75rem, env(safe-area-inset-right)) max(0.55rem, env(safe-area-inset-bottom))
      max(0.75rem, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
  }

  #repeat-panel.repeat-panel--room #repeat-actions.repeat-actions--room-mic #btn-repeat-speak {
    width: min(5.35rem, 18vw);
    height: min(5.35rem, 18vw);
  }

  #repeat-panel.repeat-panel--room #repeat-actions.repeat-actions--room-mic #btn-repeat-hear,
  #repeat-panel.repeat-panel--room #repeat-actions.repeat-actions--room-mic #btn-repeat-next {
    width: 100%;
    max-width: 18rem;
  }

  .room-level-result .actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 24;
    margin: 0;
    padding: 0.65rem max(1rem, env(safe-area-inset-right)) max(0.65rem, env(safe-area-inset-bottom))
      max(1rem, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
    justify-content: center;
  }

  .room-level-result.panel,
  .room-level-result.panel--result {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 640px) and (pointer: coarse) {
  .card:hover,
  .gamehub-card:hover {
    transform: none;
  }

  .card:active,
  .gamehub-card:active {
    transform: scale(0.98);
  }
}

.remedial-panel .remedial-body {
  margin: 0.75rem 0 1rem;
  line-height: 1.55;
}

.remedial-panel .remedial-body p {
  margin: 0 0 0.65rem;
}

.remedial-panel .remedial-body h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1rem;
}

.lesson-analysis-panel__subtitle {
  margin: 0.25rem 0 0.75rem;
  font-size: 1rem;
  opacity: 0.92;
}

.lesson-analysis-pl__big {
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}

.lesson-analysis-list {
  margin: 0.35rem 0 1rem;
  padding-left: 1.2rem;
}

.lesson-analysis-list li {
  margin-bottom: 0.4rem;
}

.lesson-analysis-compare {
  margin: 1rem 0;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: rgba(45, 106, 227, 0.08);
}

.lesson-analysis-next-card {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.lesson-analysis-next-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.lesson-analysis-next-card__body {
  margin: 0;
  line-height: 1.5;
}

.streak-row {
  margin: 0.5rem auto 0;
  max-width: 28rem;
  text-align: center;
}

.streak-pill {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #fff4e6, #ffe0c2);
  border: 1px solid rgba(255, 140, 60, 0.35);
}

.streak-motivation-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 20, 30, 0.45);
  backdrop-filter: blur(4px);
}

.streak-motivation-dialog {
  max-width: 26rem;
  width: 100%;
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.streak-motivation-dialog__title {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
}

.streak-motivation-dialog__body {
  margin: 0 0 1rem;
  line-height: 1.5;
}

.phoneme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.phoneme-tile {
  border-radius: 10px;
  padding: 0.45rem 0.4rem;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.78rem;
  line-height: 1.25;
}

.phoneme-tile__tag {
  display: block;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.phoneme-tile__pct {
  display: block;
  font-size: 0.85rem;
  margin: 0.15rem 0;
}

.phoneme-tile__tier {
  display: block;
  opacity: 0.88;
  font-size: 0.72rem;
}

.phoneme-tile--t0 {
  background: #f3f4f6;
}
.phoneme-tile--t1 {
  background: #dbeafe;
}
.phoneme-tile--t2 {
  background: #bbf7d0;
}
.phoneme-tile--t3 {
  background: #86efac;
}

.teacher-insight {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(45, 106, 227, 0.08);
  line-height: 1.5;
}
