:root{
  --bg-1:#fff9ef;
  --bg-2:#eef9ff;
  --ink:#1f2a44;
  --muted:#5d6782;
  --accent:#ffbf3f;
  --accent-2:#ff7aa2;
  --mint:#68d8c8;
  --sky:#79b8ff;
  --card:#ffffffd9;
  --border:#d8e7ff;
  --shadow:0 10px 24px rgba(69, 111, 173, .16);
}

*{box-sizing:border-box}

html,body{overflow-x:hidden}

body{
  margin:0;
  color:var(--ink);
  font-family:"Cairo","Tajawal","Nunito","Trebuchet MS",sans-serif;
  background:
    radial-gradient(circle at 15% 8%, #ffe8a5 0, #ffe8a500 18%),
    radial-gradient(circle at 86% 18%, #c8f4ff 0, #c8f4ff00 22%),
    radial-gradient(circle at 22% 90%, #ffd3e2 0, #ffd3e200 19%),
    linear-gradient(160deg,var(--bg-1),var(--bg-2));
  min-height:100vh;
}

a{color:inherit;text-decoration:none}
.container{max-width:1360px;margin:0 auto;padding:0 22px}

.topbar{
  position:sticky;
  top:0;
  z-index:99;
  backdrop-filter:blur(10px);
  background:linear-gradient(90deg,#ffffffd6,#ffffffb8);
  border-bottom:1px solid var(--border);
}

.topbar-inner{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0}
.brand{
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:center;
  column-gap:10px;
  row-gap:2px;
  min-width:330px;
}
.brand-logo{
  width:120px;
  max-width:32vw;
  height:auto;
  object-fit:contain;
  margin-bottom:0;
  grid-column:1;
  grid-row:1 / span 2;
}
.brand-name{
  font-size:22px;
  font-weight:900;
  line-height:1.05;
  grid-column:2;
}
.brand-tagline{
  font-size:12px;
  color:var(--muted);
  font-weight:700;
  grid-column:2;
}

.nav{display:flex;align-items:center;justify-content:flex-start;gap:10px;flex-wrap:wrap}
.nav a{color:var(--ink);font-weight:800;padding:5px 7px;border-radius:999px}
.nav a:hover{background:#ffffffa8}

.lang-switch{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid #c9dbff;
  background:#fff;
  border-radius:999px;
  padding:4px;
}

.lang-switch a{
  font-size:12px;
  font-weight:900;
  padding:4px 8px;
  border-radius:999px;
}

.lang-switch a.active{
  background:#e8f2ff;
  color:#1e3767;
}

.btn,.btn-outline{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 15px;
  border-radius:999px;
  font-weight:900;
  border:2px solid transparent;
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.btn{
  background:linear-gradient(135deg,var(--accent),#ffd978);
  color:#4b2f03;
  box-shadow:0 8px 0 #e5a623, 0 11px 16px rgba(229,166,35,.35);
}

.btn:hover{
  transform:translateY(-2px);
  filter:brightness(1.03);
}

.btn-outline{
  color:var(--ink);
  border-color:#b9d2ff;
  background:#ffffffcf;
}

.btn-outline:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow);
}

.full{width:100%}
.page{min-height:72vh}

.hero{
  padding:46px 0 28px;
}

.home-watermark-screen{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:3;
  overflow:hidden;
}

.wm-screen-item{
  position:absolute;
  left:0;
  top:0;
  width:clamp(120px, 16vw, 220px);
  aspect-ratio:4/3;
  object-fit:cover;
  border-radius:22px;
  opacity:.05;
  filter:grayscale(.1) saturate(.8);
  box-shadow:0 10px 28px rgba(32,57,98,.18);
  will-change:transform;
  pointer-events:auto;
  cursor:zoom-in;
}

.topbar a,
.topbar button,
.page a,
.page button{
  position:relative;
  z-index:6;
}

.page{
  position:relative;
  z-index:2;
}

.hero-inner{display:grid;grid-template-columns:1.08fr .92fr;gap:20px;align-items:stretch}
.hero-text h1{margin:0 0 10px;font-size:44px;line-height:1.14}
.lead{color:var(--muted);font-size:17px;line-height:1.9;margin:0}
.cta{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}

.badges{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.badge{
  padding:8px 11px;
  border:2px dashed #bcd6ff;
  border-radius:999px;
  color:#39558f;
  background:#fff;
  font-weight:800;
  font-size:13px;
}

.card,.feature,.program{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:var(--shadow);
}

.pad{padding:18px}
.card-title{font-weight:900;margin-bottom:10px;font-size:20px}
.card-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:11px 0;
  border-bottom:1px solid #dbe9ff;
  color:#3e4f71;
}
.card-row:last-child{border-bottom:none}

.section{padding:32px 0}
.section.alt{
  background:linear-gradient(0deg,#ffffff86,#ffffff86);
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
}

.section h1,.section h2{
  margin:0 0 12px;
  font-size:42px;
  line-height:1.15;
}

.muted{color:var(--muted)}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}

.games-layout{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.game-card h3{margin:0 0 8px}
.game-stats{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin:10px 0 12px;
}

.game-stats span{
  background:#fff;
  border:1px solid #d4e5ff;
  border-radius:999px;
  padding:6px 10px;
  font-weight:800;
}

.reaction-arena{
  position:relative;
  width:100%;
  height:260px;
  border:2px dashed #bdd5ff;
  border-radius:16px;
  background:linear-gradient(180deg,#f7fbff,#eef6ff);
  overflow:hidden;
}

.reaction-arena .reaction-target{
  position:absolute;
  display:block;
  width:52px;
  height:52px;
  border:none;
  border-radius:999px;
  background:radial-gradient(circle at 35% 35%, #ffec9f, #ffbe34);
  box-shadow:0 8px 16px rgba(229,166,35,.35);
  cursor:pointer;
  z-index:1;
}

.memory-board{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
}

.memory-card{
  border:none;
  border-radius:14px;
  height:74px;
  font-size:30px;
  background:#dfeeff;
  cursor:pointer;
  transition:transform .15s ease, background .15s ease;
}

.memory-card:hover{transform:translateY(-1px)}
.memory-card.is-open{background:#fff}
.memory-card.is-matched{
  background:#dbffee;
  cursor:default;
}

.ttt-board{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}

.ttt-cell{
  border:none;
  border-radius:14px;
  min-height:74px;
  background:#e8f2ff;
  font-size:34px;
  font-weight:900;
  color:#263a67;
  cursor:pointer;
}

.ttt-cell:disabled{
  cursor:default;
  opacity:.9;
}

.color-prompt,
.math-question{
  margin:10px 0 12px;
  padding:12px 14px;
  border:1px solid #d4e5ff;
  background:#fff;
  border-radius:12px;
  font-weight:900;
}

.color-options,
.math-options{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
}

.color-option,
.math-option{
  border:none;
  border-radius:12px;
  min-height:48px;
  font-weight:900;
  cursor:pointer;
}

.math-option{
  background:#e8f2ff;
  color:#243861;
}

.math-option:hover,
.ttt-cell:hover,
.color-option:hover{
  transform:translateY(-1px);
}

.games-subtitle{
  margin:24px 0 12px;
  font-size:30px;
}

.arcade-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
  gap:14px;
}

.mini-game{
  min-height:330px;
}

.mini-prompt{
  margin:8px 0 10px;
  min-height:58px;
  padding:10px 12px;
  border:1px solid #d4e5ff;
  border-radius:12px;
  background:#fff;
  font-weight:900;
  line-height:1.5;
}

.mini-options{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:8px;
}

.mini-option{
  border:none;
  border-radius:12px;
  min-height:44px;
  background:#e8f2ff;
  color:#253962;
  font-weight:900;
  cursor:pointer;
  transition:transform .14s ease, box-shadow .14s ease;
}

.mini-option:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 12px rgba(45,73,119,.16);
}

.mini-symbol-row{
  display:inline-block;
  margin-top:6px;
  font-size:22px;
  line-height:1.4;
}

.feature,.program{
  padding:18px;
}

.feature h3,.program h3{
  margin:0 0 8px;
  font-size:24px;
}

.feature p,.program p{
  margin:0;
  color:var(--muted);
  line-height:1.85;
}

.form{margin-top:12px}
.form label{display:block;margin:10px 0;color:#44557a;font-weight:800}

.form input,.form select,.form textarea{
  width:100%;
  padding:11px 12px;
  border-radius:14px;
  border:2px solid #cfe0ff;
  background:#fff;
  color:var(--ink);
  outline:none;
}

.form input:focus,.form select:focus,.form textarea:focus{
  border-color:var(--mint);
  box-shadow:0 0 0 4px rgba(104,216,200,.2);
}

.form textarea{resize:vertical}
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}

.alert{
  border-radius:14px;
  padding:12px;
  border:2px solid transparent;
  margin:12px 0;
}

.alert.success{background:#dbffee;border-color:#7ce0b7}
.alert.error{background:#ffe4e8;border-color:#ff9ab0}

.gallery{display:grid;grid-template-columns:repeat(4,1fr);gap:11px;margin-top:12px}

.gitem{
  border:2px solid #d4e5ff;
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  box-shadow:var(--shadow);
}

.gitem img{
  width:100%;
  height:190px;
  object-fit:cover;
  display:block;
}

.media-grid{
  grid-template-columns:repeat(12,minmax(0,1fr));
  grid-auto-flow:dense;
  gap:14px;
}

.media-card{
  position:relative;
  display:block;
  cursor:pointer;
  grid-column:span 4;
  aspect-ratio:1/1;
  transition:transform .18s ease, box-shadow .18s ease;
}

.media-card:hover{
  transform:translateY(-3px);
  box-shadow:0 14px 24px rgba(57,89,140,.24);
}

.media-card.tile-normal{grid-column:span 4;aspect-ratio:1/1}
.media-card.tile-wide{grid-column:span 8;aspect-ratio:16/9}
.media-card.tile-tall{grid-column:span 4;aspect-ratio:3/4}
.media-card.tile-large{grid-column:span 6;aspect-ratio:4/3}

.media-card[data-media-type="video"]{
  grid-column:span 6;
  aspect-ratio:16/9;
}

.media-badge{
  position:absolute;
  top:10px;
  left:10px;
  z-index:2;
  font-size:12px;
  font-weight:900;
  background:#ffffffde;
  color:#34446d;
  border:1px solid #cfe0ff;
  border-radius:999px;
  padding:4px 10px;
}

.media-video video{
  width:100%;
  height:220px;
  object-fit:cover;
  display:block;
  background:#000;
}

.gallery-title{
  margin:20px 0 10px;
  font-size:30px;
}

.gallery-meta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:12px;
}

.gallery-meta span{
  background:#fff;
  border:1px solid #d4e5ff;
  border-radius:999px;
  padding:6px 12px;
  font-weight:800;
}

.gallery-filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:12px 0 4px;
}

.gallery-category-filters{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin:10px 0 4px;
}

.filter-btn{
  border:1px solid #c9dbff;
  background:#fff;
  color:#2f416c;
  font-weight:900;
  border-radius:999px;
  padding:8px 14px;
  cursor:pointer;
}

.filter-btn.is-active{
  background:linear-gradient(135deg,var(--accent),#ffd978);
  color:#4b2f03;
  border-color:#e3b142;
}

.category-btn{
  min-width:128px;
  border:1px solid #1c2a43;
  background:#fff;
  color:#0f223f;
  font-weight:800;
  font-size:13px;
  border-radius:0;
  padding:11px 20px;
  cursor:pointer;
  transition:background-color .16s ease, color .16s ease, border-color .16s ease;
}

.category-btn.is-active{
  background:#8fae9c;
  color:#0e213e;
  border-color:#8fae9c;
}

[data-media-item].is-hidden{display:none}

.media-thumb{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  background:#f3f8ff;
}

/* Override old fixed-height gallery rule so tiled cards are not truncated. */
.media-card > .media-thumb{
  height:100%;
}

/* Fill gallery cards fully to avoid white letterboxing around some photos. */
.media-card[data-media-type="image"] > .media-thumb{
  object-fit:cover;
  background:transparent;
}

.media-thumb.is-loading{
  filter:blur(8px);
  transform:scale(1.03);
}

.media-thumb.is-ready{
  filter:none;
  transform:none;
  transition:filter .22s ease, transform .22s ease;
}

.media-video-thumb{
  background:#111;
  pointer-events:none;
}

.video-play{
  position:absolute;
  inset:0;
  margin:auto;
  width:54px;
  height:54px;
  border:none;
  border-radius:999px;
  background:#ffffffde;
  color:#283a66;
  font-size:20px;
  font-weight:900;
  cursor:pointer;
  pointer-events:none;
}

.lightbox{
  position:fixed;
  inset:0;
  z-index:300;
  display:none;
}

.lightbox.is-open{
  display:block;
}

.lightbox-backdrop{
  position:absolute;
  inset:0;
  background:rgba(10,17,34,.72);
  backdrop-filter:blur(4px);
}

.lightbox-dialog{
  position:relative;
  z-index:2;
  width:min(92vw,1000px);
  max-height:90vh;
  margin:5vh auto;
  background:#0f1931;
  border:1px solid #314a7e;
  border-radius:18px;
  padding:18px;
  box-shadow:0 20px 40px rgba(0,0,0,.45);
}

.lightbox-content{
  width:100%;
  max-height:72vh;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border-radius:12px;
  background:#000;
}

.lightbox-content img,
.lightbox-content video{
  max-width:100%;
  max-height:72vh;
  width:auto;
  height:auto;
  display:block;
}

.lightbox-caption{
  margin-top:10px;
  color:#d9e7ff;
  font-weight:700;
  text-align:center;
}

.lightbox-close{
  position:absolute;
  top:10px;
  right:10px;
  width:40px;
  height:40px;
  border:none;
  border-radius:999px;
  background:#ffffff;
  color:#25355b;
  font-size:28px;
  line-height:1;
  cursor:pointer;
}

.lightbox-nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:42px;
  height:42px;
  border:none;
  border-radius:999px;
  background:#ffffffea;
  color:#2d416f;
  font-size:30px;
  cursor:pointer;
}

.lightbox-nav.prev{left:10px}
.lightbox-nav.next{right:10px}

.map{width:100%;height:320px;border:2px solid #cde0ff;border-radius:16px}

.footer{
  margin-top:20px;
  border-top:1px solid var(--border);
  padding:22px 0;
  background:#ffffffbf;
}

.footer-inner{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

.footer-title{font-weight:900;font-size:22px;margin-bottom:6px}
.footer-actions{display:flex;gap:10px;flex-wrap:wrap}
.copyright{margin-top:14px;color:var(--muted);font-size:13px}

.list{margin:0;padding:0 20px;color:#45557b;line-height:1.9;font-weight:700}

.social{display:flex;gap:10px;align-items:center}

.iconbtn{
  width:34px;
  height:34px;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:2px solid #d6e6ff;
  background:#fff;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow:0 6px 14px rgba(57,89,140,.15);
}

.iconbtn svg{width:18px;height:18px;fill:currentColor}
.iconbtn.fb{color:#1877f2}
.iconbtn.ig{color:#e1306c}
.iconbtn.tt{color:#121212}

.iconbtn:hover{
  transform:translateY(-2px) rotate(-3deg);
  box-shadow:0 10px 16px rgba(57,89,140,.22);
}

.phone-ltr{
  direction:ltr;
  unicode-bidi:isolate;
  display:inline-block;
  text-align:left;
}

@media (max-width: 1020px){
  .hero-inner{grid-template-columns:1fr}
  .grid3{grid-template-columns:1fr 1fr}
  .container{padding:0 16px}
  .brand{min-width:auto}
  .media-grid{grid-template-columns:repeat(8,minmax(0,1fr))}
  .media-card.tile-normal{grid-column:span 4}
  .media-card.tile-wide{grid-column:span 8}
  .media-card.tile-tall{grid-column:span 4}
  .media-card.tile-large{grid-column:span 8}
  .media-card[data-media-type="video"]{grid-column:span 8}
  .hero-text h1{font-size:37px}
  .section h1,.section h2{font-size:34px}
  .wm-screen-item{width:clamp(100px, 18vw, 170px);opacity:.04}
}

@media (max-width: 740px){
  .grid3,.grid2,.grid{grid-template-columns:1fr}
  .games-layout{grid-template-columns:1fr}
  .gallery{grid-template-columns:1fr}
  .media-grid{grid-template-columns:1fr}
  .topbar-inner{padding:8px 0;gap:8px}
  .brand{
    grid-template-columns:1fr;
    row-gap:2px;
    min-width:0;
  }
  .brand-logo{
    width:98px;
    grid-column:1;
    grid-row:auto;
  }
  .brand-name{font-size:21px;grid-column:1}
  .brand-tagline{font-size:11px;grid-column:1}
  .media-card,
  .media-card.tile-normal,
  .media-card.tile-wide,
  .media-card.tile-tall,
  .media-card.tile-large,
  .media-card[data-media-type="video"]{
    grid-column:span 1;
    aspect-ratio:4/3;
  }
  .lightbox-dialog{width:95vw;padding:12px}
  .lightbox-nav{width:36px;height:36px;font-size:25px}
  .hero-text h1{font-size:31px}
  .section h1,.section h2{font-size:30px}
  .wm-screen-item{width:clamp(84px, 22vw, 130px);opacity:.032}
  .topbar-inner{align-items:flex-start}
}


.games-launcher{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:12px;
  margin-top:14px;
}

.game-launcher{
  border:1px solid #cfe0ff;
  background:#ffffffd9;
  border-radius:16px;
  padding:14px 10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  cursor:pointer;
  box-shadow:var(--shadow);
  transition:transform .16s ease, box-shadow .16s ease;
}

.game-launcher:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 24px rgba(57,89,140,.22);
}

.launcher-icon{
  width:54px;
  height:54px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:28px;
  background:linear-gradient(135deg,#fff6d7,#ffe6a9);
  border:1px solid #f3ce6f;
}

.launcher-title{
  font-size:14px;
  font-weight:900;
  text-align:center;
  color:#22365f;
  line-height:1.35;
}

body.modal-open{overflow:hidden}

.game-modal{
  position:fixed;
  inset:0;
  z-index:300;
  display:none;
}

.game-modal.is-open{display:block}

.game-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(8,16,34,.62);
  backdrop-filter:blur(4px);
}

.game-modal-dialog{
  position:relative;
  z-index:2;
  width:min(92vw,860px);
  max-height:90vh;
  overflow:auto;
  margin:5vh auto;
  background:#f8fbff;
  border:1px solid #c9dcff;
  border-radius:18px;
  box-shadow:0 24px 46px rgba(0,0,0,.28);
  padding:16px;
}

.game-modal-close{
  position:absolute;
  top:8px;
  right:10px;
  width:38px;
  height:38px;
  border:none;
  border-radius:999px;
  background:#fff;
  font-size:28px;
  line-height:1;
  cursor:pointer;
}

.game-modal-header{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}

.game-modal-icon{
  width:42px;
  height:42px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  background:#fff7df;
  border:1px solid #efd185;
}

.game-modal-header h3{
  margin:0;
  font-size:28px;
}

.game-modal-content .memory-board{margin-top:8px}

.mini-color-chip{
  display:inline-block;
  width:30px;
  height:30px;
  border-radius:999px;
  border:2px solid #fff;
  box-shadow:0 0 0 1px #bacfee;
  vertical-align:middle;
}

@media (max-width:740px){
  .games-launcher{grid-template-columns:repeat(2,minmax(0,1fr))}
  .game-modal-dialog{width:95vw;padding:12px}
  .game-modal-header h3{font-size:23px}
}

html[dir="rtl"] .game-modal-close{
  right:auto;
  left:10px;
}

.games-progress{
  margin:8px 0 12px;
  padding:10px 14px;
  border:1px solid #cfe0ff;
  background:#ffffffd9;
  border-radius:12px;
  font-weight:900;
  color:#29406d;
}

.game-launcher{
  position:relative;
}

.launcher-state{
  position:absolute;
  top:8px;
  left:8px;
  font-size:11px;
  font-weight:900;
  background:#ecf4ff;
  border:1px solid #cddfff;
  color:#355185;
  border-radius:999px;
  padding:3px 8px;
}

html[dir="rtl"] .launcher-state{
  left:auto;
  right:8px;
}

.game-launcher.is-locked{
  opacity:.6;
  filter:grayscale(.2);
  cursor:not-allowed;
}

.game-launcher.is-locked .launcher-state{
  background:#f4f4f4;
  border-color:#d9d9d9;
  color:#666;
}

.game-launcher.is-complete{
  border-color:#9dddb6;
  box-shadow:0 10px 18px rgba(56,145,89,.18);
}

.game-launcher.is-complete .launcher-state{
  background:#e5fff0;
  border-color:#a4e0bc;
  color:#1f7340;
}

.game-pass-msg{
  margin-top:12px;
  border:1px solid #a5e1bc;
  background:#e9fff2;
  color:#1e7040;
  border-radius:12px;
  padding:10px 12px;
  font-weight:900;
}
