@font-face { font-family: "Readex Pro"; font-weight: 400; src: url("fonts/readex-pro-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Readex Pro"; font-weight: 500; src: url("fonts/readex-pro-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Readex Pro"; font-weight: 700; src: url("fonts/readex-pro-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Readex Pro"; font-weight: 400; src: url("fonts/readex-pro-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Readex Pro"; font-weight: 500; src: url("fonts/readex-pro-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Readex Pro"; font-weight: 700; src: url("fonts/readex-pro-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

/* التصميم مبني على 1280 بكسل ويتكبّر لأي شاشة: 1rem = 16px عند 1280 */
html { font-size: calc(100vw / 80); }
html, body { margin: 0; height: 100%; background: #0B0D12; color: #F2F3F5; font-family: "Readex Pro", sans-serif; overflow: hidden; }
* { box-sizing: border-box; }

.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: flex; }

/* الشعار */
.brand { display: flex; align-items: center; gap: 0.9rem; }
.brand svg { width: 2.75rem; height: 2.75rem; }
.brand span { font-size: 1.9rem; font-weight: 700; }

/* شاشة التحميل والانتظار */
#screen-loading, #screen-ready { flex-direction: column; align-items: center; justify-content: center; gap: 1.6rem; text-align: center; }
#screen-ready h1 { margin: 0; font-size: 2.6rem; font-weight: 700; }
#screen-ready p { margin: 0; font-size: 1.4rem; color: #B4BCC9; line-height: 1.7; }
.ok-mark { width: 5rem; height: 5rem; border-radius: 50%; background: #1F2A12; display: flex; align-items: center; justify-content: center; }
.ok-mark svg { width: 2.6rem; height: 2.6rem; }
.spinner { width: 3rem; height: 3rem; border-radius: 50%; border: 0.3rem solid #262C3A; border-top-color: #C8F135; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* شاشة الربط */
#screen-pair { flex-direction: column; padding: 3.5rem 5rem; gap: 3rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.status { display: flex; align-items: center; gap: 0.6rem; font-size: 1.1rem; color: #B4BCC9; }
.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #FF9A4D; }
.dot.on { background: #C8F135; }
.pair-grid { display: flex; gap: 5rem; align-items: center; flex-grow: 1; }
.pair-grid > div { flex: 1 1 0; }
.pair-grid h1 { margin: 0 0 2rem; font-size: 2.9rem; font-weight: 700; line-height: 1.35; }
.steps { display: flex; flex-direction: column; gap: 1.4rem; }
.step { display: flex; align-items: center; gap: 1.1rem; font-size: 1.4rem; }
.step b { width: 2.75rem; height: 2.75rem; border-radius: 50%; background: #151924; border: 1px solid #2E3546; display: flex; align-items: center; justify-content: center; color: #C8F135; font-weight: 500; flex-shrink: 0; }
.hint { margin-top: 2rem; font-size: 1.05rem; color: #8A93A5; }
.code-card { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; padding: 3rem 2rem; border-radius: 1.75rem; background: #151924; border: 1px solid #262C3A; }
.code-card .label { font-size: 1.1rem; color: #B4BCC9; }
.code { display: flex; gap: 0.75rem; direction: ltr; }
.code span { width: 4.5rem; height: 5.75rem; border-radius: 1rem; background: #0B0D12; border: 2px solid #C8F135; display: flex; align-items: center; justify-content: center; font-size: 3.25rem; font-weight: 700; }
.code-card .expires { font-size: 1rem; color: #8A93A5; }

/* شاشة اللعب */
#screen-play { background: #000; }
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
#badge { position: absolute; top: 1.75rem; right: 2rem; display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.9rem; border-radius: 999px; background: rgba(11, 13, 18, 0.7); font-size: 0.95rem; font-weight: 500; transition: opacity 0.6s; }
#badge svg { width: 1.4rem; height: 1.4rem; }
#badge.dim { opacity: 0; }

/* الترجمة: تطلع مكان الإنجليزي وتغطيه */
#sub-mask { position: absolute; display: none; border-radius: 0.5rem; background: rgba(12, 14, 19, 0.96); }
#sub-mask.show { display: block; }
#sub { position: absolute; left: 50%; bottom: 4rem; transform: translateX(-50%); max-width: 80%; display: none; flex-direction: column; align-items: center; gap: 0.5rem; }
#sub.show { display: flex; }
#sub .text { padding: 0.75rem 1.75rem; border-radius: 0.75rem; background: rgba(0, 0, 0, 0.78); font-size: 1.9rem; font-weight: 500; line-height: 1.55; text-align: center; direction: rtl; white-space: pre-line; }
#sub .text.nobg { background: transparent; text-shadow: 0 0 0.2rem #000, 0 0 0.4rem #000, 0.1rem 0.1rem 0.15rem #000; }
#sub .speaker { color: #C8F135; }
#sub .reviewed { display: none; align-items: center; gap: 0.4rem; padding: 0.25rem 0.75rem; border-radius: 999px; background: rgba(0, 0, 0, 0.55); font-size: 0.8rem; color: #B4BCC9; }
#sub .reviewed.on { display: flex; }

#toast { position: absolute; left: 50%; top: 2rem; transform: translateX(-50%); padding: 0.75rem 1.5rem; border-radius: 0.75rem; background: #151924; border: 1px solid #2E3546; font-size: 1.1rem; display: none; z-index: 10; }
#toast.show { display: block; }
