/* Oulpan Gérald — styles communs. Public senior : gros corps de texte,
   gros boutons, contrastes forts, libellés en toutes lettres. */
@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@400;500;700&family=Nunito:wght@400;600;700&display=swap');

:root {
  --creme: #FAF5EC;
  --encre: #22303F;
  --nuit: #1E3A5F;
  --bleu: #1E5A8A;
  --dore: #C08A3E;
  --vert: #4A7A46;
  --rouge: #B0432F;
  --carte: #FFFFFF;
  --bord: #E3D9C8;
}

* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0;
  background: var(--creme);
  color: var(--encre);
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}
.hebrew, [dir="rtl"] { font-family: 'Frank Ruhl Libre', 'Times New Roman', serif; }

/* ---------- header ---------- */
.topbar {
  background: var(--nuit);
  color: var(--creme);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.logo {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--dore); color: var(--nuit);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
  font-family: 'Frank Ruhl Libre', serif;
  flex-shrink: 0;
}
.topbar .brand { font-size: 1.25rem; font-weight: 700; }
.topbar .brand small { display: block; font-size: .8rem; font-weight: 400; opacity: .8; }
.topbar .spacer { flex: 1; }
.whoami { font-size: .95rem; opacity: .9; }

.nav {
  display: flex; gap: 8px; padding: 10px 12px;
  background: #F1E8D8; border-bottom: 1px solid var(--bord);
  overflow-x: auto;
}
.nav a {
  text-decoration: none; color: var(--nuit);
  font-weight: 700; font-size: 1.02rem;
  padding: 10px 16px; border-radius: 12px; white-space: nowrap;
}
.nav a.active, .nav a:hover { background: var(--nuit); color: var(--creme); }

.wrap { max-width: 900px; margin: 0 auto; padding: 20px 16px 60px; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 12px 26px;
  border: 0; border-radius: 16px; cursor: pointer;
  font-family: inherit; font-size: 1.15rem; font-weight: 700;
  background: var(--bleu); color: #fff;
  text-decoration: none;
  transition: transform .06s, filter .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.green { background: var(--vert); }
.btn.gold { background: var(--dore); color: var(--nuit); }
.btn.red { background: var(--rouge); }
.btn.ghost { background: transparent; color: var(--bleu); border: 2px solid var(--bleu); }
.btn.big { min-height: 72px; font-size: 1.35rem; width: 100%; }
.btn.small { min-height: 44px; font-size: .95rem; padding: 8px 16px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- cartes / formulaires ---------- */
.card {
  background: var(--carte); border: 1px solid var(--bord);
  border-radius: 18px; padding: 22px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 10px; font-size: 1.3rem; color: var(--nuit); }
.muted { color: #6B7686; }
input[type=text], input[type=password], input[type=datetime-local], textarea, select {
  width: 100%; padding: 14px 16px;
  font-family: inherit; font-size: 1.1rem;
  border: 2px solid var(--bord); border-radius: 12px;
  background: #fff; color: var(--encre);
}
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(30,90,138,.35); border-color: var(--bleu); }
label { display: block; font-weight: 700; margin: 14px 0 6px; color: var(--nuit); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.tile {
  background: var(--carte); border: 1px solid var(--bord); border-radius: 18px;
  padding: 22px; text-decoration: none; color: var(--encre);
  display: flex; flex-direction: column; gap: 6px;
}
.tile:hover { border-color: var(--bleu); }
.tile .em { font-size: 2rem; }
.tile b { font-size: 1.15rem; color: var(--nuit); }

.banner-live {
  background: var(--vert); color: #fff; border-radius: 18px;
  padding: 22px; margin-bottom: 18px; text-align: center;
}
.banner-live .pulse {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; margin-right: 8px; animation: pulse 1.2s infinite;
}
@keyframes pulse { 50% { opacity: .3; } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--nuit); color: #fff; padding: 14px 22px;
  border-radius: 14px; font-size: 1.05rem; z-index: 999;
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
}

/* ---------- salle de classe ---------- */
body.room-body { background: #131C28; color: #F2EDE3; overflow: hidden; }
.room-shell { display: flex; flex-direction: column; height: 100dvh; }
.room-top {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: #1E3A5F; color: var(--creme); flex-wrap: wrap;
}
.room-top .title { font-weight: 700; font-size: 1.05rem; }
.room-main { flex: 1; display: flex; min-height: 0; }
.slide-zone {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--creme); color: var(--encre);
  margin: 10px; border-radius: 18px; padding: 18px; min-width: 0;
  text-align: center; overflow: auto; position: relative;
}
.slide-heb { font-size: clamp(1.9rem, 6vw, 4rem); direction: rtl; font-family: 'Frank Ruhl Libre', serif; line-height: 1.4; }
.slide-pho { font-size: clamp(1rem, 2.6vw, 1.5rem); color: #8A6A3A; font-style: italic; margin-top: 8px; }
.slide-fra { font-size: clamp(1.1rem, 3vw, 1.8rem); color: var(--bleu); margin-top: 12px; font-weight: 700; }
.slide-note { font-size: 1rem; color: #6B7686; margin-top: 10px; }
.slide-img { max-width: 100%; max-height: 62vh; border-radius: 10px; }
.slide-count { position: absolute; top: 10px; right: 14px; font-size: .9rem; color: #8A8578; }
.videos {
  width: 240px; padding: 10px 10px 10px 0; display: flex; flex-direction: column;
  gap: 8px; overflow-y: auto; flex-shrink: 0;
}
.vid {
  position: relative; background: #22303F; border-radius: 12px; overflow: hidden;
  aspect-ratio: 4/3; flex-shrink: 0; border: 2px solid transparent;
}
.vid.prof { border-color: var(--dore); }
.vid.speaking { border-color: #7FBF7A; }
.vid.spot { border-color: #E8C877; }
.vid video { width: 100%; height: 100%; object-fit: cover; }
.vid .tag {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(19,28,40,.75); color: #fff;
  font-size: .85rem; padding: 3px 8px; display: flex; align-items: center; gap: 6px;
}
.vid .noVideo {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: #fff;
}
.vid .hand { position: absolute; top: 6px; right: 8px; font-size: 1.3rem; }
.room-bottom {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  padding: 10px 14px 14px; flex-wrap: wrap;
}
.rbtn {
  min-width: 86px; min-height: 64px; border-radius: 16px; border: 0; cursor: pointer;
  background: #2A3B50; color: #F2EDE3; font-family: inherit; font-size: .9rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.rbtn .ic { font-size: 1.5rem; }
.rbtn.off { background: var(--rouge); }
.rbtn.on { background: var(--vert); }
.rbtn.leave { background: #6E2B1E; }
.rbtn:active { transform: scale(.97); }
.chat-panel {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(340px, 92vw);
  background: #1B2837; display: flex; flex-direction: column; z-index: 50;
  transform: translateX(100%); transition: transform .2s;
}
.chat-panel.open { transform: none; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msgs .m { background: #24344A; border-radius: 12px; padding: 8px 12px; font-size: .98rem; }
.chat-msgs .m b { color: #E8C877; }
.chat-input { display: flex; gap: 8px; padding: 12px; }
.chat-input input { flex: 1; }
.overlay {
  position: fixed; inset: 0; background: rgba(12,18,26,.88); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay .inner { background: var(--creme); color: var(--encre); border-radius: 22px; padding: 30px; max-width: 460px; width: 100%; text-align: center; }
.prof-strip {
  display: flex; gap: 8px; align-items: center; padding: 6px 14px; flex-wrap: wrap;
  background: #172335;
}
.prof-strip .rbtn { min-height: 50px; min-width: 70px; font-size: .8rem; }
.hands-list { color: #E8C877; font-size: .95rem; }

@media (max-width: 720px) {
  .room-main { flex-direction: column; }
  .videos { width: 100%; flex-direction: row; padding: 0 10px; height: 120px; }
  .vid { width: 130px; }
  .slide-zone { margin: 8px; }
  .rbtn { min-width: 72px; min-height: 56px; }
}
