
/* ---- Scope ---- */
.drtory-classroom-hub.v1{
  --paper:#f7f1e1;
  --ink:#1a2a3a;
  --mint:#7bdcb5;
  --pink:#ff71b8;
  --shadow: 0 18px 40px rgba(16,24,40,.15);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--ink);
  max-width: 1100px;
  margin: 0 auto;
}

/* ---- Tickering strips ---- */
.drtory-classroom-hub .hub-ticker{
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(0,0,0,.10);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  background:
    radial-gradient(12px 12px at 20% 30%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(10px 10px at 70% 60%, rgba(255,255,255,.35), transparent 60%),
    linear-gradient(180deg, #ffffffaa, #ffffff55);
  backdrop-filter: blur(6px);
}
.drtory-classroom-hub .hub-ticker-top{ margin: 10px 0 14px; }
.drtory-classroom-hub .hub-ticker-bottom{ margin: 14px 0 10px; }

.drtory-classroom-hub .hub-ticker-track{ width:100%; overflow:hidden; position:relative; }
.drtory-classroom-hub .hub-ticker-row{
  display:inline-flex; gap:10px; padding:12px 14px; align-items:center;
  will-change: transform; white-space: nowrap;
}
.drtory-classroom-hub .hub-ticker-right .hub-ticker-row{ animation: hubDriftRight 22s linear infinite; }
.drtory-classroom-hub .hub-ticker-left .hub-ticker-row{ animation: hubDriftLeft 26s linear infinite; }
@keyframes hubDriftRight{ from{ transform: translateX(-50%);} to{ transform: translateX(0%);} }
@keyframes hubDriftLeft{ from{ transform: translateX(0%);} to{ transform: translateX(-50%);} }

/* ---- Glitch letters ---- */
.drtory-classroom-hub .hub-chip{
  background: linear-gradient(180deg,#fff,#f7f7f7);
  border:1px solid rgba(0,0,0,.12);
  border-radius:999px;
  padding:8px 12px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(0,0,0,.06);
  color:#0e2238;
  position:relative;
}
.drtory-classroom-hub .hub-glitch::before,
.drtory-classroom-hub .hub-glitch::after{
  content: attr(data-text);
  position:absolute; left:0; top:0; width:100%; height:100%;
  border-radius:999px; padding:8px 12px; opacity:0; pointer-events:none;
}
.drtory-classroom-hub .hub-glitch::before{ transform: translate(1px,0); color: var(--pink); }
.drtory-classroom-hub .hub-glitch::after{ transform: translate(-1px,0); color: var(--mint); }
.drtory-classroom-hub .hub-glitch{ animation: hubGlitchPulse 3.8s infinite; }
@keyframes hubGlitchPulse{ 0%,92%,100%{ filter:none;} 93%{ filter:contrast(1.1) saturate(1.2);} }
.drtory-classroom-hub .hub-glitch:nth-child(7n)::before,
.drtory-classroom-hub .hub-glitch:nth-child(7n)::after{
  opacity:.75; animation: hubGlitchJitter .18s steps(2,end) 2;
}
@keyframes hubGlitchJitter{
  0%{ clip-path: inset(0 0 60% 0); }
  50%{ clip-path: inset(40% 0 15% 0); }
  100%{ clip-path: inset(10% 0 45% 0); }
}

/* ---- Card ---- */
.drtory-classroom-hub .hub-card{
  background:
    radial-gradient(600px 220px at 20% 10%, rgba(255,210,74,.35), transparent 60%),
    radial-gradient(520px 220px at 80% 20%, rgba(123,220,181,.28), transparent 60%),
    linear-gradient(180deg, var(--paper), #fff);
  border-radius: 22px;
  border: 2px solid rgba(0,0,0,.10);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.drtory-classroom-hub .hub-card-header{
  display:flex; justify-content:space-between; gap:14px;
  padding:18px 18px 10px; align-items:flex-start;
}
.drtory-classroom-hub .hub-badge{
  display:inline-block;
  background:#ffffffcc;
  border:1px dashed rgba(0,0,0,.20);
  border-radius:999px;
  padding:6px 10px;
  font-weight: 900;
  font-size: 12px;
  margin-bottom: 8px;
}
.drtory-classroom-hub h2{ margin:0; font-size:24px; letter-spacing:-.02em; }
.drtory-classroom-hub p{ margin:6px 0 0; color: rgba(26,42,58,.82); font-weight: 650; }

.drtory-classroom-hub .hub-stickers{ display:inline-flex; gap:8px; padding-top:6px; }
.drtory-classroom-hub .hub-sticker{
  width:38px; height:38px; display:grid; place-items:center;
  border-radius:14px; background:#ffffffcc; border:1px solid rgba(0,0,0,.10);
  box-shadow: 0 10px 20px rgba(0,0,0,.06);
  transform: rotate(-2deg);
}
.drtory-classroom-hub .hub-sticker:nth-child(2){ transform: rotate(3deg); }
.drtory-classroom-hub .hub-sticker:nth-child(3){ transform: rotate(-4deg); }
.drtory-classroom-hub .hub-sticker:nth-child(4){ transform: rotate(2deg); }

/* ---- Controls ---- */
.drtory-classroom-hub .hub-bar{
  display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between;
  padding: 12px 14px 14px;
}
.drtory-classroom-hub .hub-btn{
  cursor:pointer;
  border-radius:999px;
  padding:10px 14px;
  border:2px solid rgba(0,0,0,.12);
  background:#fff;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  transition: transform .08s ease;
}
.drtory-classroom-hub .hub-btn:hover{ transform: translateY(-1px); }
.drtory-classroom-hub .hub-btn.is-active{ outline:4px solid rgba(255,209,74,.35); border-color: rgba(0,0,0,.18); }
.drtory-classroom-hub .hub-btn.sm{ padding: 9px 12px; font-size: 13px; }

.drtory-classroom-hub .hub-link{
  text-decoration:none;
  font-weight: 900;
  padding:10px 14px;
  border-radius:999px;
  border:2px solid rgba(0,0,0,.12);
  background: linear-gradient(180deg,#ffffff,#f7f7f7);
  color: var(--ink);
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  white-space: nowrap;
}

/* ---- Viewer ---- */
.drtory-classroom-hub .hub-viewer{
  margin: 0 14px 12px;
  border-radius: 18px;
  overflow:hidden;
  border:2px solid rgba(0,0,0,.10);
  background:#fff;
  box-shadow: 0 14px 28px rgba(0,0,0,.08);
}
.drtory-classroom-hub iframe{
  width:100%;
  height: 760px;
  border:0;
  background:#fff;
}
.drtory-classroom-hub .hub-note{
  display:flex; gap:10px; align-items:flex-start;
  padding: 10px 14px 16px;
  color: rgba(26,42,58,.85);
  font-weight: 700;
}
.drtory-classroom-hub .hub-pin{ font-size: 18px; }

/* ---- AI Panel ---- */
.drtory-classroom-hub .hub-ai{
  margin: 0 14px 14px;
  border-radius: 18px;
  border: 2px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.65);
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
  padding: 12px;
}
.drtory-classroom-hub .hub-ai-title{ font-weight: 950; }
.drtory-classroom-hub .hub-ai-sub{ opacity:.78; margin-top:4px; font-weight: 700; font-size: 12px; line-height: 1.35; }
.drtory-classroom-hub .hub-ai-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.drtory-classroom-hub .hub-ai-ask{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.drtory-classroom-hub .hub-ai-input{
  flex:1;
  min-width: 220px;
  border-radius: 14px;
  border: 2px solid rgba(0,0,0,.10);
  padding: 10px 12px;
  background: #fff;
  font-weight: 800;
  outline: none;
}
.drtory-classroom-hub .hub-ai-out{
  margin-top: 10px;
  min-height: 120px;
  border-radius: 16px;
  border: 2px dashed rgba(0,0,0,.16);
  padding: 10px 12px;
  background: #fff;
  white-space: pre-wrap;
  overflow:auto;
  font-weight: 700;
  color: rgba(0,0,0,.78);
}
.drtory-classroom-hub .hub-raw{ margin-top:10px; }
.drtory-classroom-hub .hub-raw-pre{
  white-space: pre-wrap;
  font-size: 12px;
  border-radius: 14px;
  border: 2px solid rgba(0,0,0,.08);
  background: #fff;
  padding: 10px;
}

/* ---- Gallery ---- */
.drtory-classroom-hub .hub-gallery{
  margin: 0 14px 16px;
  border-radius: 18px;
  border: 2px solid rgba(0,0,0,.10);
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
  overflow:hidden;
}
.drtory-classroom-hub .hub-gallery-head{ padding: 12px 12px 8px; }
.drtory-classroom-hub .hub-gallery-title{ font-weight: 950; }
.drtory-classroom-hub .hub-gallery-sub{ opacity: .75; font-weight: 750; margin-top: 4px; font-size: 12px; }

.drtory-classroom-hub .hub-rail{
  height: min(62vh, 560px);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid rgba(0,0,0,.06);
}
.drtory-classroom-hub .hub-slide{ scroll-snap-align: start; padding: 12px; border-bottom:1px solid rgba(0,0,0,.06); }
.drtory-classroom-hub .hub-card2{
  border-radius: 16px; overflow:hidden;
  border: 2px solid rgba(0,0,0,.08);
  background: #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
}
.drtory-classroom-hub .hub-meta{
  padding: 10px 12px;
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  font-weight: 900;
}
.drtory-classroom-hub .hub-btnrow{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.drtory-classroom-hub .hub-tag{
  font-size: 12px; opacity:.75;
  border: 2px solid rgba(0,0,0,.10);
  border-radius:999px; padding: 6px 10px; background:#fff;
}
.drtory-classroom-hub .hub-open{
  font-weight: 900; text-decoration:none; color:#0b63ce;
}
.drtory-classroom-hub .hub-open:hover{ text-decoration: underline; }
.drtory-classroom-hub .hub-preview{ padding: 8px 10px; }
.drtory-classroom-hub .hub-img{ width:100%; display:block; max-height: 420px; object-fit: contain; background:#fff; }

/* ---- Modal ---- */
.drtory-classroom-hub .hub-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  z-index: 999999;
  padding: 18px;
}
.drtory-classroom-hub .hub-modal[aria-hidden="false"]{
  display:flex; align-items:center; justify-content:center;
}
.drtory-classroom-hub .hub-modal-inner{
  width: min(100%, 980px);
  background: #fff;
  border-radius: 18px;
  overflow:hidden;
  border: 2px solid rgba(255,255,255,.25);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.drtory-classroom-hub .hub-modal-bar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 12px;
  background: linear-gradient(135deg,#eaf4ff,#ffffff);
  border-bottom: 1px solid rgba(0,0,0,.08);
  font-weight: 900;
}
.drtory-classroom-hub .hub-modal-close{
  cursor:pointer;
  border:2px solid rgba(0,0,0,.12);
  background:#fff;
  padding: 6px 10px;
  border-radius: 12px;
  font-weight: 900;
}
.drtory-classroom-hub .hub-modal-frame{
  width:100%;
  height: min(78vh, 720px);
  background:#000;
}
.drtory-classroom-hub .hub-modal-frame iframe{
  width:100%; height:100%; border:0; background:#000;
}

/* ---- ASL hand cards ---- */
.drtory-classroom-hub .hub-hands{ gap: 14px; }
.drtory-classroom-hub .hub-handCard{
  display:inline-flex; align-items:center; gap:10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #ffffffcc;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}
.drtory-classroom-hub .hub-handImg{
  width: 64px; height: 64px; object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.12));
  display:block;
}
.drtory-classroom-hub .hub-letter{
  font-weight: 1000; font-size: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(0,0,0,.18);
  background:#fff;
}

/* ---- Mobile ---- */
@media (max-width: 720px){
  .drtory-classroom-hub iframe{ height: 620px; }
  .drtory-classroom-hub .hub-card-header{ flex-direction: column; }
  .drtory-classroom-hub .hub-bar{ justify-content: flex-start; }
  .drtory-classroom-hub .hub-handImg{ width: 54px; height: 54px; }
}
@media (prefers-reduced-motion: reduce){
  .drtory-classroom-hub .hub-ticker-row{ animation: none !important; }
}
