/* BaraaKids — the student remote.  Teacher side: the 🎮 button and its card (.bkr-*).  Student side: remote.html (.rs-*). */

/* ======================= the teacher's button and card (update 118: three steps, one share for the whole site) ======================= */
@font-face { font-family: 'Tajawal'; font-weight: 400; font-display: swap;
  src: url(../fonts/tajawal-arabic-400-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200F; }
@font-face { font-family: 'Tajawal'; font-weight: 400; font-display: swap;
  src: url(../fonts/tajawal-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122; }
@font-face { font-family: 'Tajawal'; font-weight: 500; font-display: swap;
  src: url(../fonts/tajawal-arabic-500-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200F; }
@font-face { font-family: 'Tajawal'; font-weight: 500; font-display: swap;
  src: url(../fonts/tajawal-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122; }
@font-face { font-family: 'Tajawal'; font-weight: 700; font-display: swap;
  src: url(../fonts/tajawal-arabic-700-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200F; }
@font-face { font-family: 'Tajawal'; font-weight: 700; font-display: swap;
  src: url(../fonts/tajawal-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122; }
.bkr { font-family: 'Tajawal', 'Segoe UI', Tahoma, system-ui, sans-serif; }
.bkr-fab {
  position: fixed; left: 14px; bottom: 14px; z-index: 140; width: 54px; height: 54px; padding: 0; border: 3px solid #fff; border-radius: 50%;
  background: linear-gradient(160deg, #4d6bff, #2a3fd6); color: #fff; font-size: 1.55rem; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px rgba(8, 20, 50, .35); display: grid; place-items: center;
  opacity: .94; transition: transform .15s, opacity .15s, background .2s;
}
.bkr-fab:hover, .bkr-fab:focus-visible { opacity: 1; transform: scale(1.06); }
.bkr-fab:focus-visible { outline: 3px solid #ffc83d; outline-offset: 2px; }
.bkr-fab.ready { background: linear-gradient(160deg, #ffb347, #e7861a); }
.bkr-fab.live { background: linear-gradient(160deg, #34c46e, #1f8f4c); }
.bkr-fab .bkr-dot { position: absolute; top: 1px; inset-inline-end: 1px; width: 14px; height: 14px; border-radius: 50%; background: #c3c9da; border: 2px solid #fff; }
.bkr-fab.ready .bkr-dot { background: #ffc83d; }
.bkr-fab.live .bkr-dot { background: #20d46a; animation: bkrpulse 1.6s ease-in-out infinite; }
.bkr-live { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); padding: 0 .45rem; border-radius: 999px; background: #e0263f; color: #fff; font: 800 .68rem/1.5 'Tajawal', sans-serif; white-space: nowrap; }
.bkr-live:empty { display: none; }
@keyframes bkrpulse { 50% { box-shadow: 0 0 0 6px rgba(32, 212, 106, .25); } }

.bkr-panel {
  position: fixed; left: 14px; bottom: 80px; z-index: 145; width: min(25rem, calc(100vw - 28px)); max-height: calc(100vh - 100px); overflow: auto;
  padding: 0 0 .9rem; border-radius: 24px; background: #fff; color: #1b2742; box-shadow: 0 18px 50px rgba(8, 20, 50, .4); text-align: start;
}
.bkr-panel[hidden] { display: none; }
.bkr-head { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem .8rem; background: linear-gradient(160deg, #4d6bff, #2a3fd6); color: #fff; border-radius: 24px 24px 0 0; }
.bkr-logo { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 14px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; font-size: 1.5rem; }
.bkr-ht { flex: 1; min-width: 0; }
.bkr-head h3 { margin: 0; font-family: inherit; font-size: 1.25rem; font-weight: 800; line-height: 1.4; color: #fff; }
.bkr-sub { margin: 0; font-size: .86rem; line-height: 1.6; opacity: .92; font-weight: 500; }
.bkr-x { flex: none; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; font-size: 1rem; cursor: pointer; }
.bkr-x:hover { background: rgba(255, 255, 255, .3); }
.bkr-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .75rem 1rem 0; }
.bkr-chip { padding: .2rem .7rem; border-radius: 999px; background: #f0f2f8; color: #6a7490; font-size: .82rem; font-weight: 800; line-height: 1.7; }
.bkr-chip.on { background: #dcf6e6; color: #0e6b3a; }
.bkr-st { margin: .6rem 1rem 0; padding: .55rem .8rem; border-radius: 14px; background: #f3f6ff; font-size: .92rem; font-weight: 700; line-height: 1.65; color: #24316b; }
.bkr-st.ok { background: #e3f8ec; color: #0e6b3a; }
.bkr-st.pause { background: #fff4dc; color: #8a5a00; }
.bkr-st.bad { background: #fde6e6; color: #a11d1d; }
.bkr-steps { list-style: none; margin: .7rem 0 0; padding: 0 1rem; display: grid; gap: .55rem; }
.bkr-step { display: flex; gap: .7rem; padding: .75rem .8rem; border: 2px solid #e6e9f3; border-radius: 18px; background: #fff; transition: opacity .2s, border-color .2s; }
.bkr-step.now { border-color: #4d6bff; background: #f6f8ff; box-shadow: 0 4px 14px rgba(51, 85, 255, .12); }
.bkr-step.done { border-color: #bfe9cf; background: #f5fcf8; }
.bkr-step.later { opacity: .55; }
.bkr-n { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: #e6e9f3; color: #4a557a; display: grid; place-items: center; font-size: 1rem; font-weight: 900; }
.bkr-step.now .bkr-n { background: #3355ff; color: #fff; }
.bkr-step.done .bkr-n { background: #22b45e; color: #fff; }
.bkr-sb { flex: 1; min-width: 0; }
.bkr-sb h4 { margin: .1rem 0 .15rem; font-family: inherit; font-size: 1.02rem; font-weight: 800; line-height: 1.5; color: #1b2742; }
.bkr-sb p { margin: 0 0 .5rem; font-size: .86rem; line-height: 1.7; color: #5a6584; font-weight: 500; }
.bkr-linkrow { display: flex; gap: .4rem; margin-bottom: .45rem; direction: ltr; }
.bkr-link {
  flex: 1; min-width: 0; padding: .5rem .65rem; border: 2px solid #e1e6f5; border-radius: 12px; background: #f7f9ff; color: #24316b;
  font: 600 .78rem/1.4 ui-monospace, Consolas, 'Courier New', monospace; text-align: left; overflow: hidden; text-overflow: ellipsis;
}
.bkr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem .95rem; border: 0; border-radius: 14px; cursor: pointer;
  font-family: inherit; font-size: .95rem; font-weight: 800; line-height: 1.3; color: #24316b; background: #e8ecfb; transition: transform .1s, filter .15s, background .15s;
}
.bkr-btn[hidden] { display: none; }
.bkr-btn:hover { filter: brightness(.96); }
.bkr-btn:active { transform: translateY(2px); }
.bkr-btn:disabled { opacity: .5; cursor: default; }
.bkr-btn.done { background: #22b45e; color: #fff; }
.bkr-btn.bad { background: #fde3e3; color: #a11d1d; }
.bkr-btn:focus-visible { outline: 3px solid #ffc83d; outline-offset: 2px; }
.bkr-btn svg { width: 1.25em; height: 1.25em; fill: currentColor; }
.bkr-linkrow .bkr-btn { flex: none; background: #3355ff; color: #fff; }
.bkr-wa { width: 100%; background: #25d366; color: #fff; }
.bkr-big { width: 100%; padding: .75rem 1rem; font-size: 1.08rem; background: linear-gradient(160deg, #4d6bff, #2a3fd6); color: #fff; box-shadow: 0 4px 0 #1f2fa8; }
.bkr-big.soft { background: #eef0f7; color: #4a557a; box-shadow: none; }
.bkr-step:not(.now) .bkr-big:not(.soft) { box-shadow: none; }
.bkr-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.bkr-row .bkr-btn { flex: 1 1 auto; }
.bkr-foot { padding: .6rem 1rem 0; }
.bkr-lnk { display: block; margin: 0 0 .3rem; padding: .1rem 0; border: 0; background: none; font: 700 .8rem/1.5 inherit; font-family: inherit; color: #6a7490; text-decoration: underline; cursor: pointer; text-align: start; }
.bkr-lnk:hover { color: #1b2742; }
.bkr-note { margin: 0; font-size: .78rem; line-height: 1.7; color: #8a93ab; font-weight: 500; }

.bkr-tap { position: fixed; z-index: 148; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: rgba(255, 122, 26, .55); border: 3px solid #ff7a1a; pointer-events: none; animation: bkrtap .8s ease-out forwards; }
@keyframes bkrtap { to { transform: scale(3.2); opacity: 0; } }
.bkr-toast { position: fixed; left: 50%; bottom: 90px; z-index: 460; transform: translateX(-50%); max-width: min(30rem, calc(100vw - 2rem)); padding: .7rem 1.1rem; border-radius: 14px; background: #1b2742; color: #fff; font: 700 .95rem/1.6 'Tajawal', system-ui, sans-serif; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
@media (max-width: 520px) { .bkr-fab { width: 50px; height: 50px; left: 10px; bottom: 10px; } .bkr-panel { left: 10px; bottom: 74px; } }
@media (prefers-reduced-motion: reduce) { .bkr-fab.live .bkr-dot, .bkr-tap { animation: none; } }

/* ======================= the student's page (remote.html) ======================= */
.rs-body { margin: 0; height: 100vh; height: 100dvh; overflow: hidden; background: #070b1e; color: #fff; font-family: 'Tajawal', 'Segoe UI', Tahoma, system-ui, sans-serif; touch-action: none; -webkit-user-select: none; user-select: none; }
.rs-stage { position: fixed; inset: 0; background: #000; overflow: hidden; }
.rs-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; transform-origin: 0 0; will-change: transform; }
.rs-bar { position: fixed; top: 8px; inset-inline: 8px; z-index: 5; display: flex; align-items: center; gap: .5rem; pointer-events: none; }
.rs-bar > * { pointer-events: auto; }
.rs-pill { margin-inline-end: auto; padding: .3rem .8rem; border-radius: 999px; background: rgba(10, 16, 40, .72); color: #fff; font-size: .9rem; font-weight: 700; line-height: 1.5; backdrop-filter: blur(4px); }
.rs-pill i { display: inline-block; width: 9px; height: 9px; margin-inline-end: .4rem; border-radius: 50%; background: #9aa3b8; }
.rs-pill.live i { background: #20d46a; }
.rs-pill.wait i { background: #ffc83d; }
.rs-ib { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(10, 16, 40, .72); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(4px); }
.rs-ib[hidden] { display: none; }
.rs-ib:focus-visible, .rs-big:focus-visible { outline: 3px solid #ffc83d; outline-offset: 2px; }
.rs-msg { position: fixed; inset: 0; z-index: 4; display: grid; place-content: center; gap: .6rem; padding: 1.5rem; text-align: center; background: radial-gradient(circle at 50% 35%, #1d2a6b 0%, #0a1030 70%); }
.rs-msg[hidden] { display: none; }
.rs-msg .rs-em { font-size: 3.6rem; line-height: 1.2; }
.rs-msg h1 { margin: 0; font-size: 1.6rem; font-weight: 800; line-height: 1.5; }
.rs-msg p { margin: 0; max-width: 24rem; font-size: 1.05rem; line-height: 1.8; color: #cfd6f2; font-weight: 500; }
.rs-big { margin: .8rem auto 0; padding: .7rem 1.6rem; border: 0; border-radius: 16px; background: #ffc83d; color: #1b2742; font: 800 1.1rem/1.4 inherit; cursor: pointer; }
.rs-big[hidden] { display: none; }
.rs-rip { position: fixed; z-index: 6; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: rgba(255, 200, 61, .5); border: 3px solid #ffc83d; pointer-events: none; animation: bkrtap .7s ease-out forwards; }
.rs-cur { position: fixed; z-index: 6; width: 26px; height: 26px; margin: -3px 0 0 -3px; pointer-events: none; transition: left .06s linear, top .06s linear, opacity .3s; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.rs-cur svg { width: 100%; height: 100%; display: block; }
.rs-cur[hidden] { display: none; }
.rs-banner { position: fixed; z-index: 5; inset-inline: 0; bottom: 0; padding: .7rem 1rem; text-align: center; background: rgba(10, 16, 40, .82); color: #ffe08a; font-weight: 800; font-size: 1rem; line-height: 1.6; pointer-events: none; }
.rs-banner[hidden] { display: none; }
.rs-tb { position: fixed; z-index: 7; inset-inline: 0; bottom: 0; display: flex; gap: .5rem; padding: .6rem; background: rgba(10, 16, 40, .92); touch-action: auto; -webkit-user-select: text; user-select: text; }
.rs-tb[hidden] { display: none; }
.rs-tb input { flex: 1; min-width: 0; padding: .7rem .9rem; border: 2px solid #ffc83d; border-radius: 12px; background: #fff; color: #14203f; font: 600 1.1rem/1.4 inherit; }
.rs-tb button { padding: 0 1rem; border: 0; border-radius: 12px; background: #ffc83d; color: #1b2742; font: 800 1rem/1 inherit; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .rs-rip { animation: none; opacity: 0; } }

/* the zoom of the shared picture (update 82) */
.rs-ib.wide { width: auto; padding: 0 .9rem; border-radius: 999px; font-size: .95rem; font-weight: 800; gap: .3rem; display: inline-flex; align-items: center; }
.rs-zoom { position: fixed; z-index: 6; inset-inline-start: 10px; bottom: 12px; display: flex; align-items: center; gap: .35rem; padding: .3rem; border-radius: 999px; background: rgba(10, 16, 40, .78); backdrop-filter: blur(4px); }
.rs-zoom[hidden] { display: none; }
.rs-zb { min-width: 44px; height: 44px; padding: 0 .7rem; border: 0; border-radius: 999px; background: #ffc83d; color: #14203f; font: 800 1.35rem/1 'Tajawal', system-ui, sans-serif; cursor: pointer; }
.rs-zb[hidden] { display: none; }
.rs-zb.rs-zfit { font-size: .9rem; background: #fff; }
.rs-zb:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.rs-zl { min-width: 3.2rem; text-align: center; color: #fff; font: 700 .95rem/1 'Tajawal', system-ui, sans-serif; }
.rs-stage.zoomed { cursor: grab; }
.rs-tb:not([hidden]) ~ .rs-zoom, .rs-banner:not([hidden]) ~ .rs-zoom { bottom: 64px; }
/* update 130: while a game shows the joystick (bottom-left), the remote button moves up out of its way */
body:has(.tpad-joy) .bkr-fab { bottom: auto; top: 4.4rem; width: 44px; height: 44px; font-size: 1.25rem; }
body:has(.tpad-joy) .bkr-panel { bottom: auto; top: 8.6rem; }
