
/* ---------- Stats dashboard bar ---------- */
.stats-bar{display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px;}
.stat-pill{
  background:var(--card); border-radius:16px; padding:10px 16px; display:flex; align-items:center; gap:8px;
  box-shadow:0 4px 12px rgba(0,0,0,0.06); font-weight:700; font-size:0.88rem; flex:1; min-width:130px; justify-content:center;
}
.stat-pill .num{font-family:'Baloo 2'; font-size:1.15rem; color:var(--purple);}

/* ---------- Difficulty selector ---------- */
.difficulty-bar{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:14px;}
.diff-label{font-weight:800; font-size:0.88rem; color:var(--navy);}

/* ---------- Filter chips ---------- */
.filters{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px;}
.chip{
  background:var(--card); border:2px solid transparent; border-radius:999px; padding:8px 16px; font-weight:700;
  font-size:0.85rem; cursor:pointer; color:var(--navy); box-shadow:0 3px 8px rgba(0,0,0,0.05); transition:all .15s ease;
}
.chip.active{background:var(--navy); color:#fff;}
.chip:hover{border-color:var(--teal);}

/* ---------- Game screens (shown/hidden) ---------- */
.screen{display:none;}
.screen.active{display:block;}
.game-header{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; gap:10px;}
.hud{display:flex; gap:10px; flex-wrap:wrap;}
.hud-pill{
  background:var(--card); border-radius:999px; padding:7px 14px; font-weight:700; font-size:0.85rem;
  box-shadow:0 3px 8px rgba(0,0,0,0.06);
}
.msg-banner{
  text-align:center; font-weight:800; font-size:1.1rem; padding:14px; border-radius:16px; margin-bottom:16px;
  display:none;
}
.msg-banner.show{display:block;}
.msg-good{background:rgba(46,196,182,0.18); color:#177a70;}
.msg-bad{background:rgba(255,111,89,0.18); color:#c2452f;}
.msg-info{background:rgba(106,76,147,0.14); color:var(--purple);}

/* ---------- Game 1: Memory ---------- */
.mem-grid{display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; max-width:460px; margin:0 auto;}
.mem-card{
  aspect-ratio:1/1; border-radius:14px; background:var(--purple); display:flex; align-items:center; justify-content:center;
  font-size:1.8rem; cursor:pointer; user-select:none; transition:transform .25s ease, background .2s ease;
  box-shadow:0 4px 10px rgba(0,0,0,0.12);
}
.mem-card.flipped, .mem-card.matched{ background:#fff; border:2px solid var(--teal); transform:scale(1.03); }
.mem-card.matched{ opacity:0.55; cursor:default; border-color:var(--yellow); }

/* ---------- Game 2: Go/No-Go ---------- */
.gng-stage{
  height:260px; border-radius:18px; background:radial-gradient(circle, #eef7f7, #e2eef0);
  display:flex; align-items:center; justify-content:center; position:relative; margin-bottom:16px;
  border:2px dashed rgba(46,196,182,0.35);
}
.gng-target{
  width:110px; height:110px; border-radius:26px; display:flex; align-items:center; justify-content:center;
  font-size:2.2rem; cursor:pointer; box-shadow:0 8px 20px rgba(0,0,0,0.15); user-select:none;
  animation:pop .25s ease;
}
@keyframes pop{ from{transform:scale(0.6); opacity:0;} to{transform:scale(1); opacity:1;} }
.rule-box{
  background:var(--cream); border-radius:14px; padding:12px 16px; font-weight:700; text-align:center; margin-bottom:14px;
}

/* ---------- Game 3: Sequence (Simon) ---------- */
.simon-grid{display:grid; grid-template-columns:1fr 1fr; gap:14px; max-width:340px; margin:0 auto 16px;}
.simon-btn{
  aspect-ratio:1/1; border-radius:20px; border:none; cursor:pointer; opacity:0.55; transition:opacity .12s ease, transform .12s ease;
}
.simon-btn.lit{opacity:1; transform:scale(0.97);}
.simon-1{background:var(--teal);}
.simon-2{background:var(--coral);}
.simon-3{background:var(--yellow);}
.simon-4{background:var(--purple);}

/* ---------- Game 4: Odd one out ---------- */
.odd-grid{display:grid; grid-template-columns:repeat(4, 1fr); gap:10px; max-width:420px; margin:0 auto;}
.odd-cell{
  aspect-ratio:1/1; border-radius:14px; background:#fff; border:2px solid #e7e2d6; display:flex; align-items:center;
  justify-content:center; font-size:1.7rem; cursor:pointer; transition:transform .1s ease;
}
.odd-cell:hover{transform:scale(1.05);}

/* ---------- Game 5: Letter cancellation ---------- */
.letter-target{
  text-align:center; font-size:1.05rem; font-weight:800; margin-bottom:14px; background:var(--cream);
  border-radius:14px; padding:12px;
}
.letter-target span{
  display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:12px;
  background:var(--yellow); font-size:1.5rem; margin-right:8px; vertical-align:middle;
}
.letter-grid{display:grid; grid-template-columns:repeat(6, 1fr); gap:8px; max-width:480px; margin:0 auto;}
.letter-cell{
  aspect-ratio:1/1; border-radius:12px; background:#fff; border:2px solid #e7e2d6; display:flex; align-items:center;
  justify-content:center; font-size:1.3rem; font-weight:700; cursor:pointer; user-select:none;
}
.letter-cell.found{background:rgba(46,196,182,0.25); border-color:var(--teal); opacity:0.5; cursor:default;}
.letter-cell.wrong{animation:shake .3s ease;}
@keyframes shake{ 25%{transform:translateX(-4px);} 75%{transform:translateX(4px);} }

/* ---------- Game 6: Reaction time ---------- */
.reaction-box{
  height:260px; border-radius:18px; display:flex; align-items:center; justify-content:center; text-align:center;
  font-family:'Baloo 2'; font-weight:700; font-size:1.3rem; cursor:pointer; user-select:none; padding:20px;
  transition:background .1s ease;
}
.reaction-wait{background:linear-gradient(135deg, #f7d9d3, #f3bdb2); color:#8a3a2c;}
.reaction-go{background:linear-gradient(135deg, #b6f0e7, #7fe0d0); color:#0d5c52;}
.reaction-early{background:linear-gradient(135deg, #ffe0e0, #ffb3b3); color:#8a1f1f;}

/* ---------- Game 7: Digit span ---------- */
.digit-display{
  text-align:center; font-family:'Baloo 2'; font-size:2.4rem; font-weight:800; letter-spacing:10px; color:var(--purple);
  min-height:70px; display:flex; align-items:center; justify-content:center; margin-bottom:10px;
}
.digit-entered{
  text-align:center; font-size:1.3rem; font-weight:700; min-height:32px; color:var(--navy); margin-bottom:14px;
  letter-spacing:6px;
}
.keypad{display:grid; grid-template-columns:repeat(5, 1fr); gap:10px; max-width:420px; margin:0 auto 16px;}
.keypad button{
  aspect-ratio:1/1; border-radius:14px; border:2px solid #e7e2d6; background:#fff; font-size:1.2rem; font-weight:800;
  cursor:pointer; color:var(--navy);
}
.keypad button:hover{border-color:var(--teal);}
.keypad-actions{display:flex; gap:10px; justify-content:center;}

/* ---------- Game 8: Sorting ---------- */
.sort-stage{display:flex; flex-direction:column; align-items:center; gap:18px;}
.sort-item{
  width:100px; height:100px; border-radius:22px; background:#fff; border:3px solid var(--yellow);
  display:flex; align-items:center; justify-content:center; font-size:2.6rem; box-shadow:0 8px 18px rgba(0,0,0,0.12);
  animation:pop .2s ease;
}
.sort-bins{display:flex; gap:16px; width:100%; max-width:420px;}
.sort-bin{
  flex:1; padding:20px 10px; border-radius:16px; text-align:center; font-weight:800; cursor:pointer;
  border:2px dashed rgba(0,0,0,0.15); transition:transform .1s ease;
}
.sort-bin:hover{transform:translateY(-3px);}
.bin-a{background:rgba(46,196,182,0.18);}
.bin-b{background:rgba(255,111,89,0.18);}

/* ---------- Calm corner ---------- */
.breath-circle{
  width:160px; height:160px; border-radius:50%; margin:20px auto; background:radial-gradient(circle, #b6f0e7, #2EC4B6);
  display:flex; align-items:center; justify-content:center; color:#fff; font-family:'Baloo 2'; font-weight:800; font-size:1.1rem;
  transition:transform 4s ease-in-out; transform:scale(0.7); box-shadow:0 10px 30px rgba(46,196,182,0.35);
}
.breath-circle.in{transform:scale(1.15);}
.breath-instructions{text-align:center; font-weight:700; color:var(--text-muted); margin-top:8px;}

/* ---------- Game: Stroop (color/word inhibition) ---------- */
.stroop-word{
  text-align:center; font-family:'Baloo 2'; font-weight:800; font-size:3rem; margin:20px 0; user-select:none;
  min-height:70px;
}
.stroop-options{display:flex; gap:14px; justify-content:center; flex-wrap:wrap;}
.stroop-swatch{
  width:64px; height:64px; border-radius:50%; border:3px solid #fff; cursor:pointer; box-shadow:0 6px 14px rgba(0,0,0,0.18);
  transition:transform .1s ease;
}
.stroop-swatch:hover{transform:scale(1.08);}

/* ---------- Game: What's missing ---------- */
.miss-grid{display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; max-width:460px; margin:0 auto 14px;}
.miss-cell{
  aspect-ratio:1/1; border-radius:14px; background:#fff; border:2px solid #e7e2d6; display:flex; align-items:center;
  justify-content:center; font-size:1.9rem;
}
.miss-cell.empty{background:var(--cream); border:2px dashed rgba(106,76,147,0.4); font-size:1.4rem; color:var(--purple);}
.miss-question{text-align:center; font-weight:800; margin:6px 0 14px; font-size:1rem;}
.miss-options{display:flex; gap:12px; justify-content:center; flex-wrap:wrap;}
.miss-opt{
  width:64px; height:64px; border-radius:16px; background:#fff; border:2px solid #e7e2d6; display:flex; align-items:center;
  justify-content:center; font-size:1.8rem; cursor:pointer; transition:transform .1s ease;
}
.miss-opt:hover{transform:scale(1.08);}

/* ---------- Game: Crossword ---------- */
.cross-grid{
  display:inline-grid; gap:3px; background:#e7e2d6; padding:3px; border-radius:10px;
  margin:0 auto 18px;
}
.cross-cell{width:44px; height:44px; position:relative;}
.cross-cell.blocked{background:transparent;}
.cross-cell input{
  width:100%; height:100%; text-align:center; font-size:1.2rem; font-weight:800;
  border:2px solid #e7e2d6; border-radius:6px; background:#fff; color:var(--navy);
}
.cross-cell input:focus{outline:none; border-color:var(--teal);}
.cross-cell input.correct{border-color:var(--teal); background:rgba(46,196,182,0.18);}
.cross-cell input.wrong{border-color:var(--coral); background:rgba(255,111,89,0.18);}
.cross-num{position:absolute; top:1px; right:3px; font-size:0.6rem; font-weight:800; color:var(--purple); pointer-events:none;}
.cross-clues{text-align:right;}
.cross-clues ol{margin:0; padding-inline-start:20px; font-size:0.88rem; color:var(--text-muted); line-height:1.9;}
.cross-switch{display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-bottom:16px;}

/* ---------- Game: كلمة السر (password) ---------- */
.pw-clue-list{list-style:none; margin:0 0 16px; padding:0; display:flex; flex-direction:column; gap:8px;}
.pw-clue-list li{background:var(--cream); border-radius:12px; padding:10px 14px; font-weight:600; font-size:0.9rem;}
.pw-input-row{display:flex; gap:10px; justify-content:center; margin-bottom:14px; flex-wrap:wrap;}
.pw-input-row input{
  flex:1; max-width:220px; padding:12px 14px; border-radius:12px; border:2px solid #e7e2d6;
  font-size:1rem; font-family:inherit; text-align:center;
}
.pw-input-row input:focus{outline:none; border-color:var(--teal);}

/* ---------- Game: Maze ---------- */
.maze-grid{
  display:inline-grid; gap:1px; background:#ddd8c8; padding:4px; border-radius:12px;
  margin:0 auto 18px; direction:ltr;
}
.maze-cell{background:var(--cream); display:flex; align-items:center; justify-content:center;}
.maze-cell.wall{background:var(--navy);}
.maze-cell.player{background:rgba(46,196,182,0.35);}
.maze-cell.goal{background:rgba(255,210,63,0.4);}
.maze-pad{
  display:grid; grid-template-columns:repeat(3, 58px); grid-template-rows:repeat(3, 58px);
  gap:6px; justify-content:center; margin:0 auto;
}
.maze-pad button{
  border:none; border-radius:14px; background:var(--card); box-shadow:0 4px 10px rgba(0,0,0,0.08);
  font-size:1.4rem; cursor:pointer; color:var(--navy);
}
.maze-pad button:active{transform:scale(0.94);}
.maze-pad .maze-up{grid-column:2; grid-row:1;}
.maze-pad .maze-left{grid-column:3; grid-row:2;}
.maze-pad .maze-right{grid-column:1; grid-row:2;}
.maze-pad .maze-down{grid-column:2; grid-row:3;}
.maze-hint{text-align:center; font-size:0.78rem; color:var(--text-muted); margin-top:10px;}
