:root {
  --magenta: #c84992;
  --magenta-dark: #9c2e70;
  --turquoise: #13c7cd;
  --ink: #171d33;
  --line: #ece8ef;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #fbfafd;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.classroom-page {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 100px minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 9% 12%, rgba(19, 199, 205, .09), transparent 22%),
    radial-gradient(circle at 91% 10%, rgba(200, 73, 146, .09), transparent 23%),
    #fbfafd;
}

.compact-header {
  width: min(1120px, calc(100% - 32px));
  height: 100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 118px 1fr 92px;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.event-logo, .method-logo {
  display: block;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 7px 12px rgba(55, 36, 65, .08));
}
.event-logo { width: 108px; height: 82px; justify-self: start; }
.method-logo { width: 80px; height: 78px; justify-self: end; }
.event-name { min-width: 0; text-align: center; }
.event-name > span {
  display: block;
  margin-bottom: 5px;
  color: var(--magenta-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .2em;
}
.event-name h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 850;
}
.event-name h1 i { color: var(--turquoise); font-style: normal; padding: 0 4px; }

.classroom-content {
  min-height: 0;
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  justify-items: center;
}
.lesson-heading { text-align: center; }
.lesson-heading span {
  display: inline-block;
  margin-bottom: 2px;
  color: var(--magenta);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .2em;
}
.lesson-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(23px, 2.5vw, 34px);
  line-height: 1.05;
  letter-spacing: -.025em;
}

.video-shell {
  position: relative;
  align-self: stretch;
  width: min(100%, calc((100svh - 240px) * 16 / 9));
  max-height: calc(100svh - 240px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(35, 25, 42, .16);
  border-radius: 15px;
  background: #121219;
  box-shadow: 0 18px 50px rgba(39, 27, 46, .16);
}
.player-frame, .youtube-mount, .youtube-mount iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0;
}
.youtube-mount iframe { pointer-events: none !important; }
.player-shield { position: absolute; inset: 0; z-index: 3; background: transparent; }
.player-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(255, 255, 255, .82);
  background: linear-gradient(135deg, #171723, #291628);
  font-size: 13px;
  font-weight: 700;
}
.player-loading.is-hidden { display: none; }
.loading-ring {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, .22);
  border-top-color: var(--turquoise);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.floating-controls {
  position: absolute;
  z-index: 7;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 11px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 8px 24px rgba(20, 17, 27, .16);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}
.control-actions, .speed-controls { display: flex; align-items: center; gap: 6px; }
.floating-controls button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  background: rgba(23, 29, 51, .08);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}
.floating-controls button:disabled { opacity: .45; cursor: wait; }
.floating-controls .play-control { color: #fff; background: linear-gradient(135deg, var(--magenta-dark), var(--magenta)); box-shadow: 0 5px 14px rgba(200, 73, 146, .24); }
.floating-controls .secondary-control, .floating-controls .seek-control { color: var(--ink); background: rgba(23, 29, 51, .08); }
.speed-controls { margin-left: auto; gap: 3px; padding: 3px; border: 1px solid rgba(23, 29, 51, .08); border-radius: 9px; background: rgba(23, 29, 51, .045); }
.speed-label { padding: 0 6px 0 4px; color: #626578; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.floating-controls .speed-button { min-width: 38px; min-height: 30px; padding: 0 8px; color: #5f6171; background: transparent; box-shadow: none; }
.floating-controls .speed-button.active { color: var(--magenta-dark); background: #fff; box-shadow: 0 2px 8px rgba(28, 21, 34, .12); }
.floating-controls button:focus-visible { outline: 2px solid var(--turquoise); outline-offset: 2px; }
.play-symbol { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid #fff; }
.pause-symbol { width: 9px; height: 10px; border-left: 3px solid #fff; border-right: 3px solid #fff; }
.sound-symbol, .muted-symbol { position: relative; display: inline-block; width: 15px; height: 14px; }
.sound-symbol::before, .muted-symbol::before { content: ""; position: absolute; left: 0; top: 4px; width: 5px; height: 6px; border-radius: 1px; background: currentColor; }
.sound-symbol::after, .muted-symbol::after { content: ""; position: absolute; left: 4px; top: 2px; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 7px solid currentColor; }
.muted-symbol { opacity: .5; }
.fullscreen-symbol { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 2px; }

.video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px;
  text-align: center;
  color: #fff;
  background: radial-gradient(circle at center, rgba(19, 199, 205, .14), transparent 37%), linear-gradient(135deg, #171723, #291628);
}
.video-placeholder span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--turquoise), var(--magenta)); font-size: 16px; font-weight: 950; }
.video-placeholder strong { font-size: clamp(15px, 2vw, 22px); }
.video-placeholder small { color: rgba(255, 255, 255, .58); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.under-video {
  width: min(100%, 920px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}
.materials-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--magenta-dark), var(--magenta));
  box-shadow: 0 10px 24px rgba(200, 73, 146, .22);
  font-size: 13px;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease;
}
.materials-button:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(200, 73, 146, .28); }
.materials-button b { font-size: 16px; }
.folder-icon { width: 19px; height: 14px; position: relative; border: 2px solid currentColor; border-radius: 3px; }
.folder-icon::before { content: ""; position: absolute; width: 8px; height: 4px; left: -2px; top: -6px; border: 2px solid currentColor; border-bottom: 0; border-radius: 3px 3px 0 0; }
.lesson-switcher { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.lesson-switcher a { color: #8b8792; font-size: 11px; font-weight: 850; }
.lesson-switcher a.active { color: var(--magenta-dark); }
.lesson-switcher span { width: 1px; height: 16px; background: #dcd6df; }

@media (min-width: 901px) and (max-height: 720px) {
  .classroom-page { grid-template-rows: 84px minmax(0, 1fr); }
  .compact-header { height: 84px; grid-template-columns: 98px 1fr 76px; }
  .event-logo { width: 92px; height: 70px; }
  .method-logo { width: 68px; height: 66px; }
  .event-name h1 { font-size: 23px; }
  .classroom-content { padding-top: 8px; gap: 7px; }
  .lesson-heading h2 { font-size: 26px; }
  .video-shell { width: min(100%, calc((100svh - 208px) * 16 / 9)); max-height: calc(100svh - 208px); }
  .materials-button { min-height: 42px; }
}

@media (max-width: 700px) {
  .classroom-page { min-height: 100svh; grid-template-rows: 84px minmax(0, 1fr); overflow: auto; }
  .compact-header { width: min(100% - 20px, 1120px); height: 84px; grid-template-columns: 66px 1fr 52px; gap: 8px; }
  .event-logo { width: 64px; height: 66px; }
  .method-logo { width: 50px; height: 54px; }
  .event-name > span { margin-bottom: 3px; font-size: 7px; letter-spacing: .14em; }
  .event-name h1 { font-size: clamp(13px, 4.2vw, 18px); line-height: 1.12; }
  .event-name h1 i { display: none; }
  .classroom-content { width: min(100% - 20px, 1040px); padding: 11px 0; gap: 9px; }
  .lesson-heading span { font-size: 8px; }
  .lesson-heading h2 { font-size: clamp(21px, 6vw, 27px); }
  .video-shell { align-self: auto; width: 100%; max-height: none; aspect-ratio: auto; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .player-frame { position: relative; width: 100%; height: auto !important; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid rgba(35, 25, 42, .16); border-radius: 12px; background: #121219; box-shadow: 0 12px 30px rgba(39, 27, 46, .14); }
  .floating-controls { position: relative; left: auto; right: auto; bottom: auto; display: grid; grid-template-columns: 1fr; gap: 4px; margin-top: 6px; padding: 5px; border-radius: 9px; background: rgba(255, 255, 255, .92); }
  .control-actions { display: grid; grid-template-columns: 34px minmax(78px, 1fr) 34px 32px 32px; gap: 4px; }
  .floating-controls button { min-height: 29px; padding: 0 7px; gap: 5px; font-size: 9px; }
  .floating-controls .play-control { min-width: 0; white-space: nowrap; }
  .floating-controls .seek-control, .floating-controls .secondary-control { width: 32px; min-width: 32px; padding: 0; }
  .floating-controls .seek-control { width: 34px; min-width: 34px; }
  .control-label { display: none; }
  .speed-controls { justify-content: center; margin-left: 0; gap: 3px; padding: 2px; }
  .speed-label { padding-right: 5px; font-size: 8px; }
  .floating-controls .speed-button { min-width: 34px; min-height: 25px; padding: 0 5px; font-size: 9px; }
  .under-video { grid-template-columns: 1fr; gap: 8px; }
  .materials-button { min-height: 46px; font-size: 12px; }
  .lesson-switcher { justify-content: center; padding-bottom: 2px; }
}

@media (max-width: 420px) and (max-height: 740px) {
  .classroom-page { grid-template-rows: 72px minmax(0, 1fr); }
  .compact-header { height: 72px; }
  .event-logo { width: 56px; height: 56px; }
  .method-logo { width: 43px; height: 46px; }
  .classroom-content { padding-top: 7px; gap: 6px; }
  .lesson-heading h2 { font-size: 20px; }
  .materials-button { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
