:root{--navy:#061b3d;--deep:#12305f;--gold:#f2c230;--red:#c92334;--green:#28c76f}*{box-sizing:border-box}body{margin:0;font-family:Georgia,'Times New Roman',serif;background:#061b3d;color:#fff}header{position:sticky;top:0;z-index:99;background:#031632;border-bottom:4px solid var(--gold);padding:12px 16px;text-align:center}h1{margin:0;font-size:clamp(1.3rem,3vw,2.4rem)}h2,h3{margin:.35rem 0 .75rem}.gold{color:var(--gold)}.version{font-size:13px;color:#ffe083;margin-top:4px;font-weight:700}.wrap{max-width:1420px;margin:0 auto;padding:16px}.tabs{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0 18px}.tab{border:1px solid var(--gold);background:#08275a;color:#fff;border-radius:999px;padding:10px 18px;font-weight:700;cursor:pointer}.tab.active{background:var(--gold);color:#061a3b}.grid{display:grid;grid-template-columns:minmax(330px,.95fr) minmax(380px,1.05fr);gap:18px;align-items:start}@media(max-width:980px){.grid{grid-template-columns:1fr}}.panel{background:#12305f;border:2px solid var(--gold);border-radius:18px;padding:18px;box-shadow:0 8px 22px #0005;overflow:hidden}.panel.light{background:#f7fbff;color:#08275a}.panel.light h2,.panel.light h3{color:#08275a}.hidden{display:none!important}.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.grow{flex:1}.btn{font:inherit;background:var(--gold);color:#061a3b;border:0;border-radius:12px;padding:11px 16px;font-weight:700;cursor:pointer;margin:4px}.btn.red{background:#d94545;color:#fff}.btn.blue{background:#fff;color:#08275a}.btn.green{background:var(--green);color:#061a3b}.btn:disabled{opacity:.55;cursor:not-allowed}.small{font-size:.95rem;opacity:.95}.joinbox{border:1px dashed var(--gold);border-radius:10px;padding:10px;color:var(--gold);word-break:break-all;background:#061a3b;margin:8px 0}.notice{background:#061a3b;border:1px solid #315da0;border-radius:12px;padding:10px;margin:10px 0;color:#fff}.status{font-weight:700;color:var(--gold);min-height:28px}.status.success{color:#0b7a3a}.status.danger{color:#8b0000}.winner{background:#125e2c;border:2px solid #52e284;color:#fff;border-radius:14px;padding:12px;margin:12px 0;font-size:1.25rem;text-align:center;font-weight:700}.boardBox{position:relative;display:block;margin:0 auto;line-height:0;background:#071839;overflow:hidden}.boardBox img{display:block;width:100%;height:auto;border:0}.boardBox.master{width:min(100%,620px)}.boardBox.student{width:min(100%,620px)}.chip{position:absolute;border-radius:50%;background:radial-gradient(circle at 35% 28%,#ff8585 0 18%,#d63a3f 19% 57%,#a60f1d 58% 100%);border:4px solid #fff;box-shadow:0 3px 10px #0009;transform:translate(-50%,-50%);z-index:20;pointer-events:none}.masterChip{width:7.8%;aspect-ratio:1/1}.studentChip{width:10%;aspect-ratio:1/1}.hotspot{position:absolute;width:22%;height:13%;transform:translate(-50%,-50%);border:0;background:transparent;cursor:pointer;z-index:25}.hotspot:hover,.hotspot:focus{background:rgba(244,194,56,.14);outline:2px dashed var(--gold);border-radius:12px}.cardStage{min-height:600px;display:flex;align-items:center;justify-content:center;perspective:1200px;background:#071f48;border-radius:18px;padding:16px;overflow:hidden}.currentCard{display:block;width:auto;max-width:min(430px,100%);max-height:660px;height:auto;object-fit:contain;border-radius:22px;box-shadow:0 12px 28px #0009;background:#fff;transition:transform .35s ease,opacity .18s ease}.flipOut{transform:rotateY(90deg);opacity:.15}.cardCaption{text-align:center;color:var(--gold);font-weight:700;font-size:1.1rem;margin-top:8px}.diag{font-size:12px;color:#ffe083;margin-top:6px;word-break:break-all;background:#061a3b;padding:6px;border-radius:8px}.error{color:#ffdddd;background:#6b1010;border:1px solid #ff8888}.playerList{background:#061a3b;border-radius:12px;padding:10px;max-height:260px;overflow:auto}.playerRow{border-bottom:1px solid #315da0;padding:8px}.input{padding:10px;border-radius:10px;border:1px solid #aaa;font:inherit}.badge{display:inline-block;background:#0b7a3a;color:#fff;border-radius:999px;padding:3px 8px;font-size:12px;font-weight:bold;margin-left:4px}.teamCard{border:1px solid #315da0;background:#061a3b;border-radius:12px;padding:10px;margin:8px 0}.teamLink{color:#ffe083;word-break:break-all;font-size:12px}.chatLog{height:180px;overflow:auto;background:#fff;color:#08275a;border-radius:12px;padding:10px}.chatLine{border-bottom:1px solid #ddd;padding:6px}.videoPreview{background:#00112d;border:1px solid var(--gold);border-radius:12px;width:100%;max-width:420px;aspect-ratio:16/9;object-fit:cover;margin:8px auto;display:block}.landingHero{background:linear-gradient(180deg,#dff3ff 0%,#b9dcff 48%,#eaf8ff 100%);color:#061b3d;border:3px solid var(--gold);border-radius:24px;padding:22px;text-align:center;box-shadow:0 10px 24px #0006}.landingHero img{max-width:min(420px,92%);border-radius:22px;box-shadow:0 12px 25px #0007;background:#061b3d}.wizardGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin-top:18px;text-align:left}.wizardCard{background:#fff;border:2px solid #8abde8;border-radius:18px;padding:16px;color:#061b3d;box-shadow:0 6px 14px #0002}.wizardCard h3{color:#061b3d}.primaryAction{font-size:1.2rem;padding:15px 22px;border-radius:16px}.landingActions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin:18px 0}.mutedBlue{color:#113f73}.stepNumber{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:var(--gold);color:#061b3d;font-weight:800;margin-right:6px}.joinCard{background:#f7fbff;color:#08275a;border:2px solid #8abde8;border-radius:18px;padding:18px;margin-bottom:14px;box-shadow:0 6px 16px #0002}.joinGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:12px 0}.boardChoice{display:block;border:2px solid #8abde8;background:#fff;border-radius:14px;padding:12px;cursor:pointer;font-weight:700}.boardChoice.taken{opacity:.55;background:#e5e5e5;cursor:not-allowed}.boardChoice.mine{border-color:#28c76f;background:#e9fff2}.waitingRoom{background:#061a3b;color:#fff;border:1px solid var(--gold);border-radius:14px;padding:12px;margin:12px 0}.required{color:#c92334;font-weight:800}.profileSummary{background:#fff;color:#061b3d;border:2px solid #8abde8;border-radius:18px;padding:14px;margin:14px auto;max-width:720px;text-align:left;box-shadow:0 6px 14px #0002}.profileGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}.profileGrid label{font-weight:700}.profileGrid input,.profileGrid select{width:100%;margin-top:5px}.logoPreview{max-width:160px;max-height:160px;border:2px solid var(--gold);border-radius:12px;background:#fff;padding:6px;display:none}.profileActions{margin-top:12px;display:flex;gap:10px;flex-wrap:wrap}.profileNotice{background:#fff;color:#061b3d;border:2px solid #8abde8;border-radius:14px;padding:10px;margin:10px 0}body.live-session .scheduleBlock{display:none!important}body.schedule-only #teacher .grid,body.view-schedule #teacher .grid{grid-template-columns:1fr}body.schedule-only #teacher .grid>.panel:nth-child(2),body.view-schedule #teacher .grid>.panel:nth-child(2){display:none}body.schedule-only #teacher .grid>.panel:first-child>*:not(.scheduleBlock),body.view-schedule #teacher .grid>.panel:first-child>*:not(.scheduleBlock){display:none!important}body.schedule-only .meetingListHeading,body.schedule-only #meetingList,body.schedule-only .emailFields,body.schedule-only .emailButtons{display:none}body.view-schedule .scheduleFields,body.view-schedule .scheduleButtons{display:none!important}body.join-student .tabs [data-tab="teacher"],body.join-student .tabs [data-tab="home"],body.join-student .tabs [data-tab="profile"]{display:none}

/* V32 Student Waiting Room */
body.join-student .tabs{display:none!important}
body.join-student .wrap{max-width:1220px}
.studentJoinOnly{max-width:760px;margin:0 auto}
.successRoom{background:#eafff2!important;color:#062b17!important;border:2px solid #28c76f!important;text-align:left}
.successRoom h2{color:#062b17!important;margin-bottom:10px}.waitingPulse{display:inline-block;background:#fff3cd;color:#6b4a00;border:1px solid #f2c230;border-radius:999px;padding:10px 16px;font-weight:800;margin:8px 0;animation:pulseWait 1.2s infinite}.waitingBoard{opacity:.55;filter:saturate(.75)}.gameActiveBoard{opacity:1;filter:none}.gameActiveBoard .hotspot{pointer-events:auto}.waitingBoard .hotspot{pointer-events:none}@keyframes pulseWait{0%,100%{transform:scale(1)}50%{transform:scale(1.04)}}

/* V36 Student Confirmation Screen */
.readyRow{margin:10px 0 6px 0;align-items:center}
.readyStatus{font-weight:700;color:#06451f;background:#dfffe8;border:1px solid #28c76f;border-radius:999px;padding:8px 12px;display:inline-block}
.readyBadge{background:#28c76f!important;color:#061b3d!important}
body.join-student #studentGameArea.grid{grid-template-columns:minmax(340px,1fr) minmax(340px,1fr)}
body.join-student #studentJoinPanel{max-width:860px;margin:0 auto}

.studentLobbyOnly{max-width:760px;margin:0 auto;}
.studentLobbyOnly .waitingRoom{background:#e9fff2;color:#001f16;border:2px solid #28c76f;}
.studentLobbyOnly .waitingPulse{display:inline-block;background:#fff4d6;border:1px solid #f2c230;color:#7a5600;border-radius:999px;padding:10px 16px;font-weight:800;margin:10px 0;}
.studentClassroomOnly{align-items:start;}
.classroomPanel{border:1px solid var(--gold);border-radius:14px;padding:12px;margin-top:14px;background:#061a3b;}
.videoShell,.chatShell{margin-top:10px;}
.teacherVideoPlaceholder{border:1px dashed #ffe083;border-radius:12px;padding:20px;text-align:center;background:#09275a;color:#ffe083;font-weight:700;}


/* V39.3 Teacher Dashboard Cleanup: keep scheduling tools out of the live dashboard.
   They still appear when opened from Teacher Home using Schedule or View/Edit Schedule. */
body:not(.schedule-only):not(.view-schedule) #scheduleBlock{display:none!important;}
body.schedule-only #scheduleBlock,
body.view-schedule #scheduleBlock{display:block!important;}
.teacherLiveHint{background:#061a3b;border:1px solid #315da0;border-radius:12px;padding:10px;margin:10px 0;color:#fff;}

/* V39.4 Global Signup */
.signupMeta{display:block;color:#314b73;font-size:.9rem;margin-top:3px}
.signupFull{border-left:5px solid #b91c1c;background:#fff5f5}
.signupOpen{border-left:5px solid #15803d;background:#f0fff4}
.requestGroup{border-left:4px solid #c69214;padding-left:8px;margin:8px 0}


/* V41 Live Communication */
.teacherCommunicationPanel{margin-top:18px;border:2px solid rgba(218,165,32,.35)}
.videoRoomFrame{width:100%;min-height:340px;border:2px solid #d6c27a;border-radius:12px;background:#111}
.chatLine{padding:8px 10px;border-bottom:1px solid rgba(0,0,0,.08);line-height:1.35}
.handBadge{background:#fff3cd;color:#6b4b00;border:1px solid #e0b84a}
.smallClearHand{padding:4px 8px;font-size:12px;margin-left:6px}
.classroomChatLog{max-height:260px;overflow:auto;background:#fff;border-radius:10px;border:1px solid rgba(0,0,0,.12)}

/* V41.2 Mobile + iPhone board reliability */
@media(max-width:700px){
  .wrap{padding:8px;}
  .panel{padding:12px;border-radius:14px;}
  body.join-student #studentGameArea.grid{grid-template-columns:1fr!important;gap:12px;}
  .boardBox.student{width:100%;max-width:100vw;min-height:320px;}
  .boardBox.student img{width:100%;height:auto;display:block;object-fit:contain;}
  .cardStage{min-height:360px;padding:8px;}
  .currentCard{max-height:430px;max-width:100%;}
  .videoRoomFrame{min-height:260px;}
  .classroomTools .btn{width:100%;}
}
.boardLoadError{padding:14px;background:#fff3cd;color:#5c3d00;border:1px solid #f2c230;border-radius:10px;margin:8px 0;font-weight:700;}

/* V41.4 Student board image reliability */
.boardBox.student{background:#071839;}
.boardBox.student img{min-height:240px;background:#071839;}
.boardLoadError{position:absolute;left:10px;right:10px;top:10px;z-index:40;line-height:1.25;text-align:center;}
@media(max-width:700px){.boardLoadError{font-size:.9rem;padding:8px}.boardBox.student img{min-height:420px;}}

/* =====================================================
   V42 DONATION BUTTON + V42.1 SCHEDULE EMAIL FLOW
===================================================== */
header{
    position:sticky;
    top:0;
    z-index:999;
    background:#031632;
    border-bottom:4px solid var(--gold);
    padding:18px 120px 18px 20px;
    text-align:center;
}
.donationButton{
    position:absolute;
    top:18px;
    right:20px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    background:#FFD700;
    color:#08275a;
    padding:10px 20px;
    border-radius:30px;
    font-weight:bold;
    font-size:15px;
    border:3px solid white;
    box-shadow:0 4px 12px rgba(0,0,0,.35);
    transition:.25s;
    white-space:nowrap;
}
.donationButton:hover{
    background:#ffe760;
    transform:translateY(-2px);
}
.teacherInviteEmailBox{
    margin-top:14px;
    padding:14px;
    border:1px solid var(--gold);
    border-radius:14px;
    background:#071f48;
    color:#fff;
}
.teacherInviteTextarea{
    display:block;
    width:100%;
    min-height:150px;
    margin:8px 0 10px;
    color:#08275a;
    background:#fff;
    line-height:1.35;
}
.scheduleLimitNotice{
    color:#ffe083;
    font-weight:700;
    margin:8px 0;
}
@media(max-width:700px){
    header{padding:54px 10px 14px;}
    .donationButton{top:8px;right:8px;font-size:14px;padding:8px 16px;}
}


/* =====================================================
   V43 TEACHER CLASSROOM CLEANUP
   Separates Game Setup from the live Teacher Classroom.
===================================================== */
.v43GameSetupPanel{
  background:#12305f;
  border:2px solid var(--gold);
  border-radius:18px;
  padding:18px;
  box-shadow:0 8px 22px #0005;
  margin-bottom:18px;
}
.v43SetupBox{
  background:#061a3b;
  border:1px solid #315da0;
  border-radius:14px;
  padding:14px;
  margin:10px 0;
}
.v43SetupActions{display:flex;gap:12px;flex-wrap:wrap;margin-top:14px;}
.v43ReadyButton{font-size:1.15rem;padding:14px 24px;border-radius:16px;}
.v43DashboardGrid{display:grid;grid-template-columns:minmax(380px,1fr) minmax(380px,1fr);gap:18px;align-items:start;}
@media(max-width:980px){.v43DashboardGrid{grid-template-columns:1fr}}
body.v43-setup #teacher .grid{display:none!important;}
body.v43-setup #v43GameSetupPanel{display:block!important;}
body.v43-classroom #v43GameSetupPanel{display:none!important;}
body.v43-classroom #teacher .grid{display:grid!important;grid-template-columns:minmax(380px,1fr) minmax(380px,1fr);gap:18px;align-items:start;}
body.v43-classroom #teacher .grid>.panel:nth-child(2){order:1;}
body.v43-classroom #teacher .grid>.panel:nth-child(1){order:2;}
body.v43-classroom #teacher .grid>.panel:nth-child(1)>h2,
body.v43-classroom #teacherLiveProfile,
body.v43-classroom .teacherLiveHint,
body.v43-classroom #scheduleBlock,
body.v43-classroom #teacher .grid>.panel:nth-child(1)>p,
body.v43-classroom #joinCopyStatus,
body.v43-classroom #joinLink,
body.v43-classroom #teacherStatus,
body.v43-classroom #teacher .grid>.panel:nth-child(1)>.notice.small,
body.v43-classroom #cardDiag{display:none!important;}
body.v43-classroom #teacher .grid>.panel:nth-child(1)>h3{font-size:1.45rem;margin-top:0;}
body.v43-classroom #teacher .grid>.panel:nth-child(1)>.row{display:flex!important;gap:10px;flex-wrap:wrap;margin-bottom:12px;}
body.v43-classroom #teacher .grid>.panel:nth-child(1)>.row .btn{display:none!important;}
body.v43-classroom #openClassroom,
body.v43-classroom #nextCard,
body.v43-classroom #newGame,
body.v43-classroom #resetGame{display:inline-block!important;}
body.v43-classroom .cardStage{min-height:520px;}
body.v43-classroom .currentCard{max-height:620px;}
body.v43-classroom #teacherCommunicationPanel{margin-top:14px;}
body.v43-classroom #classroomOpenStatus{display:block!important;margin:8px 0;color:var(--gold);}
@media(max-width:700px){
  body.v43-classroom #teacher .grid{grid-template-columns:1fr!important;}
  .v43ReadyButton{width:100%;}
}


/* =====================================================
   V44 LIVEKIT CLASSROOM
===================================================== */
.livekitBox{
  background:#031632;
  border:2px solid var(--gold);
  border-radius:14px;
  padding:12px;
  margin-top:10px;
}
.livekitControls{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.livekitParticipants{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:10px;
  min-height:150px;
}
.livekitTile{
  background:#071839;
  border:1px solid #315da0;
  border-radius:12px;
  overflow:hidden;
  min-height:140px;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#ffe083;
  font-weight:700;
  text-align:center;
}
.livekitTile video{
  width:100%;
  height:100%;
  min-height:160px;
  object-fit:cover;
  display:block;
}
.livekitTile audio{width:100%;}
.livekitName{
  position:absolute;
  left:8px;
  bottom:8px;
  background:rgba(0,0,0,.65);
  color:#fff;
  border-radius:999px;
  padding:4px 8px;
  font-size:12px;
}
.livekitStatus{
  margin-top:8px;
  color:#ffe083;
  font-weight:700;
}
@media(max-width:700px){
  .livekitParticipants{grid-template-columns:1fr;}
  .livekitControls .btn{width:100%;}
}


/* =====================================================
   V43.2 TEACHER BUTTON LAYOUT FIX
   Forces the live teacher classroom controls into clear rows.
===================================================== */
.v432TeacherButtonPanel{
  background:#061a3b;
  border:2px solid var(--gold);
  border-radius:18px;
  padding:14px 18px;
  margin:0 0 16px 0;
  box-shadow:0 8px 22px #0005;
}
.v432TeacherButtonPanel h3{
  margin:0 0 10px 0;
  color:#fff;
}
.v432ButtonLine{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  align-items:center;
  margin:10px 0;
}
.v432ButtonLine .btn{
  margin:0;
  min-width:210px;
  text-align:center;
  justify-content:center;
}
.v432ButtonLine3 .btn{
  min-width:170px;
}
body:not(.v43-classroom) #v432TeacherButtonPanel{
  display:none!important;
}
body.v43-classroom #v432TeacherButtonPanel{
  display:block!important;
}
body.v43-classroom #sendJoinReminder,
body.v43-classroom #openClassroom,
body.v43-classroom #nextCard,
body.v43-classroom #resetGame,
body.v43-classroom #newGame{
  display:inline-flex!important;
}
@media(max-width:700px){
  .v432ButtonLine .btn{width:100%;min-width:0;}
}


/* =====================================================
   V44.1 MERGE FIX
   Keep V43 classroom layout while LiveKit is active.
===================================================== */
body.v43-classroom #teacher .grid > .panel:nth-child(1) > .row:not(.v432ButtonLine){
  display:none!important;
}
body.v43-classroom #v432TeacherButtonPanel{
  margin-top:0;
  margin-bottom:16px;
}
body.v43-classroom #teacher > .grid{
  margin-top:0;
}
body.v43-classroom .teacherCommunicationPanel .videoShell{
  display:block!important;
}

/* V44.2 LiveKit participant tile fix: one tile per person, no duplicate blank audio tiles */
.livekitParticipants{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;align-items:start;}
.livekitTile{position:relative;min-height:130px;border:1px solid #3d70bd;border-radius:10px;background:#08275a;overflow:hidden;display:flex;align-items:center;justify-content:center;color:#ffe083;font-weight:700;text-align:center;}
.livekitTile video{width:100%;height:100%;min-height:130px;object-fit:cover;display:block;}
.livekitTile audio{display:none;}
.livekitName{position:absolute;left:6px;right:6px;bottom:6px;background:rgba(0,0,0,.55);color:#fff;border-radius:999px;padding:3px 6px;font-size:11px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.livekitProfileTile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;color:#ffe083;min-height:130px;}
.livekitAvatar{width:54px;height:54px;border-radius:50%;background:#f2c230;color:#061b3d;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:900;}
.livekitCameraStatus{font-size:13px;color:#fff;}
.livekitPlaceholder{padding:16px;}
