/* ==========================================================
   صفحة المسابقة — وضع الهاكر + الشهادة
   ========================================================== */
.ctf-page { background: #070B1C; color: #CFDAFF; }
.ctf-page .topbar { background: rgba(7, 11, 28, .9); border-color: #1C2550; }
.ctf-page .brand-txt b, .ctf-page .nav a { color: #E6ECFF; }
.ctf-page .nav a.on, .ctf-page .nav a:hover { background: #1C2550; color: #7CFFB2; }
.ctf-page h1, .ctf-page h2, .ctf-page h3 { color: #fff; }
.ctf-page .muted { color: #8B97C8; }
.ctf-page .footer { margin-top: 30px; }
.ctf-hero { padding: 40px 0 30px; background: radial-gradient(700px 300px at 80% 0, rgba(124, 77, 255, .3), transparent), radial-gradient(600px 300px at 0 100%, rgba(34, 195, 214, .2), transparent); background-color: #070B1C; position: relative; }
.ctf-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); opacity: .6; }
.ctf-hero .wrap { position: relative; }
.ctf-hero h1 { font-size: 2.6rem; margin: 10px 0; }
.ctf-hero h1 small { font: 700 1rem var(--mono); color: #7CFFB2; vertical-align: middle; }
.ctf-hero p { max-width: 760px; }
.ctf-page code { background: rgba(124, 255, 178, .1); color: #7CFFB2; }
.term-line { font: 600 .95rem var(--mono); color: #7CFFB2; direction: ltr; text-align: left; }
.cursor { font-style: normal; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ctf-score { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.ctf-score > div { background: rgba(255, 255, 255, .06); border: 1px solid #243066; border-radius: 16px; padding: 10px 18px; }
.ctf-score b { font: 700 1.8rem var(--mono); color: var(--yellow); margin-left: 6px; }
.rules { background: rgba(255, 210, 63, .08); border: 1px solid rgba(255, 210, 63, .3); border-radius: 18px; padding: 16px 20px; margin: 24px 0 10px; }
.rules b { color: var(--yellow); }
.rules ul { margin: 6px 0 0; padding-right: 1.2em; }
.ctf-locked { background: #121A3A; border-radius: 18px; padding: 30px; text-align: center; margin: 30px 0; font-size: 1.1rem; }
.cat-h { font: 700 1.3rem var(--mono); color: #7CFFB2 !important; margin: 34px 0 14px; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.ch { background: linear-gradient(160deg, #10183A, #0B1129); border: 1px solid #222D63; border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 6px; transition: border-color .2s; min-width: 0; }
.ch:hover { border-color: #3D4C9A; }
.ch.solved { border-color: #2E9E63; background: linear-gradient(160deg, #0E2A22, #0B1129); }
.ch header { display: flex; gap: 12px; align-items: center; }
.ch header h3 { margin: 0; font-size: 1.1rem; }
.ch header small { color: #8B97C8; }
.ch-ic { font-size: 2rem; width: 52px; height: 52px; border-radius: 14px; background: #1A2350; display: grid; place-items: center; flex: none; }
.ch-pts { margin-right: auto; font: 700 1.1rem var(--mono); color: var(--yellow); background: rgba(255, 210, 63, .1); padding: .2em .7em; border-radius: 10px; white-space: nowrap; }
.solved .ch-pts { color: #7CFFB2; background: rgba(124, 255, 178, .1); }
.ch p { margin: 0; }
.ch-code { background: #050816; color: #7CFFB2; font: 700 1rem var(--mono); padding: 12px 14px; border-radius: 12px; border: 1px dashed #2A3A7A; white-space: pre-wrap; word-break: break-all; margin: 4px 0; text-align: left; }
.ch-task { color: #E6ECFF; font-weight: 600; }
.hint { background: rgba(255, 255, 255, .04); border-radius: 12px; padding: 8px 12px; font-size: .92rem; }
.hint summary { cursor: pointer; color: var(--yellow); font-weight: 600; }
.flag-form { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.ctf-page .inp { background: #050816; border-color: #2A3A7A; color: #fff; font-family: var(--mono); }
.ctf-page .inp:focus { border-color: #7CFFB2; }
.flag-msg { min-height: 1.4em; font-weight: 700; }
.flag-msg.ok { color: #7CFFB2; }
.flag-msg.no { color: #FF8C8C; }
.lesson { background: rgba(124, 255, 178, .08); border-radius: 12px; padding: 10px 12px; font-size: .92rem; }
.ch.shake { animation: shake .4s; }
.ctf-page .btn-ghost { color: #E6ECFF; box-shadow: inset 0 0 0 2px #2A3A7A; }
.ctf-page .rf { background: #0E1533; border-color: #2A3A7A; }
.ctf-page .rf-meta { border-color: #2A3A7A; }
.pf { cursor: pointer; border-radius: 6px; padding: 1px 4px; border-bottom: 2px dotted #4A5AA8; }
.pf:hover { background: rgba(255, 210, 63, .15); }
.pf.found { background: rgba(229, 72, 77, .25); border-bottom: 2px solid var(--red); }
.pf .letter { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--yellow); color: #000; font-family: var(--mono); margin-right: 4px; }
.ctf-page .rf-why { color: #FFB4B4; }
.phish-letters { padding: 0 14px 12px; }
.phish-letters b { font: 700 1.4rem var(--mono); color: var(--yellow); letter-spacing: .2em; }
.social { background: #0E1533; border-radius: 16px; padding: 12px; border: 1px solid #2A3A7A; }
.sp-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.sp-av { font-size: 2rem; width: 48px; height: 48px; border-radius: 50%; background: #1A2350; display: grid; place-items: center; flex: none; }
.sp-head small { display: block; color: #8B97C8; font-size: .8rem; }
.sp-post { background: #141D45; border-radius: 12px; padding: 10px 12px; margin-top: 8px; font-size: .93rem; }
.sp-post small { color: #6FA8FF; }
.exif { display: grid; gap: 10px; }
.exif-img { background: linear-gradient(180deg, #FF9F43, #E0457B 60%, #3B2B9E); border-radius: 14px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 2.4rem; color: #fff; }
.exif-img span { font: 700 .85rem var(--mono); }
.exif-img small { font-size: .8rem; }
.exif-t { width: 100%; border-collapse: collapse; font: .85rem var(--mono); background: #050816; border-radius: 12px; overflow: hidden; }
.exif-t th, .exif-t td { padding: 6px 10px; border-bottom: 1px solid #1C2550; text-align: left; }
.exif-t th { color: #8B97C8; font-weight: 400; }
.exif-t td { color: #7CFFB2; word-break: break-all; }
.ctf-page .caesar { background: #0E1533; border-color: #2A3A7A; }
.ctf-page .wheel span { background: #1A2350; color: #7CFFB2; }
.ctf-page .wheel b { color: #fff; }
.ctf-page .caesar textarea { background: #050816; color: #fff; border-color: #2A3A7A; }
.ascii { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; font-family: var(--mono); font-size: .78rem; }
.ascii span { background: #050816; border-radius: 8px; padding: 4px 6px; text-align: center; color: #8B97C8; }
.ascii b { color: #fff; font-size: 1rem; margin-left: 4px; }
.ascii small { display: block; color: #7CFFB2; letter-spacing: .02em; }
.ctf-page .toast { background: #1C7A4B; }
@media (max-width: 760px) {
  .ch-grid { grid-template-columns: 1fr; }
  .ctf-page .nav:not(.nav-guest) { background: #0B1129; }
  .ctf-hero h1 { font-size: 2rem; }
}

/* ---------- certificate ---------- */
.cert { background: #fff; border-radius: 10px; padding: 18px; box-shadow: var(--shadow); max-width: 900px; margin: 0 auto; }
.cert-in { border: 4px double var(--purple); border-radius: 6px; padding: 40px; text-align: center; background-image: var(--pattern); }
.cert-logos { display: flex; justify-content: center; align-items: center; gap: 24px; margin-bottom: 20px; flex-wrap: wrap; }
.cert-logos svg { width: 70px; height: 70px; }
.cert h2 { font-size: 1.3rem; color: var(--muted); margin: 0; }
.cert h1 { font-size: 3rem; background: linear-gradient(90deg, var(--purple), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cert-name { font: 700 2.2rem var(--display); color: var(--navy); border-bottom: 2px solid var(--yellow); display: inline-block; padding: 0 30px 6px; margin: 10px 0; }
.cert-badges { font-size: 2rem; display: flex; justify-content: center; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
@media print { .cert { box-shadow: none; } * { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
