/* Dafrana 2026 — student home ("الرئيسية"). Mobile first; desktop shows the same
   column centred. Tokens (--dz-*) are defined by the theme's app.css. */

.qstudy-home-page .dfrna-content--study,
body.dz.qstudy-home-page .dfrna-content--study,
.qstudy-home-page .entry-content{max-width:none;padding:0;margin:0}
.dh{
  --dh-gap:10px;
  max-width:var(--dz-col,480px);margin:0 auto;padding:0 10px calc(96px + env(safe-area-inset-bottom));
  color:var(--dz-ink);font-family:var(--dz-font);
}
.dh *{box-sizing:border-box}
.dh svg{width:1em;height:1em;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.dh a{color:inherit;text-decoration:none}
.dh img{display:block;max-width:100%}

/* Card base — cream paper with an ink outline, like the illustrations. */
.dh-card{
  position:relative;display:block;border-radius:16px;background:var(--dz-cream);
  border:1.5px solid var(--dz-line);box-shadow:0 3px 0 rgba(0,0,0,.28),inset 0 0 0 3px rgba(255,255,255,.28);
}
a.dh-card,.dh-game{transition:transform .15s ease,box-shadow .15s ease;-webkit-tap-highlight-color:transparent}
a.dh-card:active,.dh-game:active{transform:translateY(2px);box-shadow:0 1px 0 rgba(0,0,0,.28)}

/* Bars */
.dh-bar{display:block;height:10px;border-radius:99px;background:#e9dccb;border:1.5px solid var(--dz-line);overflow:hidden}
.dh-bar span{display:block;height:100%;border-radius:inherit;background:var(--dz-red);box-shadow:inset 0 -2px 0 rgba(0,0,0,.15),inset 0 2px 0 rgba(255,255,255,.3)}
.dh-bar--violet span{background:linear-gradient(90deg,#8f6bb8,#a689c9)}
.dh-bar--teal span{background:var(--dz-teal)}
.dh-bar--gold span{background:var(--dz-gold)}

/* ---------------- Hero ---------------- */
.dh-hero{position:relative;margin:0 -10px;aspect-ratio:2.25/1;overflow:hidden;border-radius:0 0 22px 22px}
.dh-hero__art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:18% 30%}
.dh-hero:after{content:"";position:absolute;inset:auto 0 0;height:34%;background:linear-gradient(transparent,var(--dz-bg));pointer-events:none}
.dh-bell{position:absolute;z-index:2;top:max(10px,env(safe-area-inset-top));left:12px;display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:rgba(28,36,51,.82);color:var(--dz-cream);border:1.5px solid rgba(255,255,255,.18);font-size:20px;backdrop-filter:blur(4px)}
.dh-bell b{position:absolute;top:-6px;right:-6px;min-width:19px;height:19px;padding:0 5px;border-radius:99px;background:var(--dz-red);color:#fff;font:800 11px/19px var(--dz-font);text-align:center;border:1.5px solid var(--dz-cream)}
.dh-logo{position:absolute;z-index:2;top:7%;right:4%;display:grid;justify-items:center;width:50%;filter:drop-shadow(0 3px 0 rgba(0,0,0,.35))}
.dh-logo strong{
  position:relative;display:block;padding:0 .32em .02em;font:400 clamp(40px,12.5vw,62px)/1.2 var(--dz-display);color:#fbefd6;
  -webkit-text-stroke:2px #3a1f1b;paint-order:stroke fill;letter-spacing:0;
}
.dh-logo strong:before{content:"";position:absolute;z-index:-1;inset:16% -4% 6%;background:var(--dz-red);border:2px solid #3a1f1b;border-radius:6px;transform:rotate(-2.5deg);clip-path:polygon(2% 8%,98% 0,100% 88%,96% 100%,4% 96%,0 20%)}
.dh-logo__book{width:26%;aspect-ratio:1.6/1;margin-bottom:-3%;background:url("../img/v4/deco-book.webp") center/contain no-repeat;position:relative;z-index:1}
.dh-logo__tag{margin-top:2px;padding:3px 10px 4px;background:#f5e7cb;border:1.5px solid #3a1f1b;border-radius:4px;font:800 clamp(10px,3vw,13px)/1.3 var(--dz-font);color:#2a1d1a;white-space:nowrap;transform:rotate(-1.5deg)}

/* ---------------- Profile ---------------- */
.dh-profile{margin-top:-14px;z-index:2;display:grid;grid-template-columns:48px minmax(0,1.1fr) minmax(0,1fr) auto;align-items:center;gap:7px;padding:9px 9px}
.dh-profile__avatar{width:48px;height:48px;padding:0;border-radius:50%;border:2px solid var(--dz-line);background:#e7b98f;overflow:hidden;cursor:pointer;box-shadow:0 0 0 3px #f8c08a inset}
.dh-profile__avatar img{width:100%;height:100%;object-fit:cover}
.dh-profile__avatar:disabled{cursor:default}
.dh-profile__who{min-width:0;padding-inline-end:8px;border-inline-end:1.5px solid rgba(43,36,32,.25)}
.dh-profile__who strong{display:block;font-size:16px;font-weight:900;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dh-profile__who span{display:flex;align-items:center;gap:4px;margin-top:3px;font-size:11.5px;font-weight:700;color:#4a3f3a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dh-profile__who span svg{font-size:15px}
.dh-profile__level{min-width:0;display:grid;gap:3px}
.dh-pill{display:inline-flex;align-items:center;justify-self:start;gap:3px;padding:1px 7px 1px 6px;border-radius:8px;background:#f2c35b;border:1.5px solid var(--dz-line);font-size:11.5px;font-weight:900;white-space:nowrap}
.dh-pill img{width:16px;height:auto}
.dh-profile__level small{font-size:11px;font-weight:700;color:#3d3431;direction:ltr;text-align:right;white-space:nowrap}
.dh-profile__level small b{font-weight:900}
.dh-profile__badge{position:relative;display:grid;place-items:center;width:46px}
.dh-profile__badge img{width:44px;height:auto}
.dh-profile__badge em{position:absolute;bottom:-2px;left:0;min-width:20px;padding:0 5px;border-radius:99px;background:var(--dz-red);color:#fff;font:800 11px/18px var(--dz-font);font-style:normal;text-align:center}
.dh-profile__badge--streak{grid-template-columns:auto auto;width:auto;gap:1px;padding:4px 6px 4px 4px;border-radius:14px;background:radial-gradient(circle at 30% 40%,#fff2c9,#f7d58a);border:1.5px solid #d99c3a}
.dh-profile__badge--streak img{width:20px}
.dh-profile__badge--streak span{font-size:10.5px;font-weight:800;line-height:1.25;text-align:center}
.dh-profile__badge--streak span b{font-size:15px;font-weight:900}

/* ---------------- Exam countdown ---------------- */
.dh-exam{margin-top:var(--dh-gap);display:flex;align-items:center;gap:8px;min-height:56px;padding:6px 12px 6px 10px;background:linear-gradient(180deg,#4d6669,#3f5759);color:#f8ecd6}
.dh-exam__art{width:66px;height:auto;margin:-18px -4px -10px 0;filter:drop-shadow(0 2px 0 rgba(0,0,0,.3))}
.dh-exam__label{flex:1;font-size:16px;font-weight:900;line-height:1.3}
.dh-exam__count{position:relative;flex:none;padding:5px 14px 6px;background:var(--dz-red);border:1.5px solid #2a1715;font-size:15px;font-weight:900;color:#fff;transform:rotate(-1.5deg);clip-path:polygon(3% 0,100% 6%,97% 100%,0 94%)}
.dh-exam__count b{font:400 26px/1 var(--dz-display);margin-inline-end:3px;vertical-align:-3px}
.dh-exam:before,.dh-exam:after{content:"";position:absolute;top:50%;width:14px;height:22px;transform:translateY(-50%);background:linear-gradient(var(--dz-gold),var(--dz-gold)) 0 0/100% 2.5px no-repeat,linear-gradient(var(--dz-gold),var(--dz-gold)) 0 50%/70% 2.5px no-repeat,linear-gradient(var(--dz-gold),var(--dz-gold)) 0 100%/100% 2.5px no-repeat;opacity:.9}
.dh-exam:before{display:none}
.dh-exam:after{display:none}

/* ---------------- Daily dose ---------------- */
.dh-dose{margin-top:var(--dh-gap);display:grid;grid-template-columns:minmax(0,1fr) 34%;grid-template-areas:"body art" "btn art";align-items:center;gap:6px 8px;padding:12px 12px 12px 6px;background:linear-gradient(135deg,#f9e5d2,#f2d6c4);overflow:hidden}
.dh-dose:after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(-45deg,transparent 0 10px,rgba(184,66,60,.035) 10px 11px);pointer-events:none}
.dh-dose__art{grid-area:art;width:100%;height:auto;margin-inline-start:-4px;filter:drop-shadow(0 2px 0 rgba(0,0,0,.18))}
.dh-dose__body{grid-area:body;text-align:center}
.dh-dose h2{display:flex;align-items:center;justify-content:center;gap:4px;margin:0;font-size:22px;font-weight:900;line-height:1.2}
.dh-dose h2 span{color:var(--dz-gold);font-size:18px}
.dh-dose p{margin:2px 0 6px;font-size:12.5px;font-weight:700;color:#4b3f3b}
.dh-dose ul{display:flex;justify-content:center;gap:10px;margin:0;padding:0;list-style:none;font-size:13px;font-weight:800}
.dh-dose li{display:flex;align-items:center;gap:4px}
.dh-dose li+li{padding-inline-start:10px;border-inline-start:1.5px solid rgba(43,36,32,.3)}
.dh-btn{grid-area:btn;position:relative;z-index:1;display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 18px;border-radius:14px;background:linear-gradient(180deg,#c9524a,#a83a34);border:1.5px solid #4b1c19;box-shadow:0 3px 0 #5a211e,inset 0 1.5px 0 rgba(255,255,255,.3);color:#fff !important;font-size:18px;font-weight:900}
.dh-btn svg{fill:currentColor;stroke:none;font-size:16px}

/* ---------------- Sections ---------------- */
.dh-section{position:relative;margin-top:16px}
.dh-title{display:flex;align-items:center;gap:7px;margin:0 2px 9px;color:#f6ead3;font-size:16px;font-weight:900}
.dh-title svg{font-size:22px;color:var(--dz-gold)}
.dh-more{position:absolute;top:2px;left:4px;display:flex;align-items:center;gap:3px;color:#d8cbb5 !important;font-size:12.5px;font-weight:700}
.dh-more:after{content:"‹";font-size:18px;line-height:1}

/* Game tiles */
.dh-games{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.dh-game{position:relative;display:block;min-height:78px;padding:8px 9px;border-radius:13px;border:1.5px solid var(--dz-line);box-shadow:0 3px 0 rgba(0,0,0,.3),inset 0 0 0 2.5px rgba(255,255,255,.22);overflow:hidden;background:var(--tile)}
.dh-game:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 80% 20%,rgba(255,255,255,.28),transparent 55%)}
.dh-game strong{position:relative;z-index:1;display:block;max-width:60%;font-size:13px;font-weight:900;line-height:1.25;color:#2a201d}
.dh-game img{position:absolute;left:3px;bottom:4px;width:42%;max-height:80%;object-fit:contain;filter:drop-shadow(0 2px 0 rgba(0,0,0,.2))}
.dh-tone--rose{--tile:linear-gradient(160deg,#e9aaa2,#d98c86)}
.dh-tone--sage{--tile:linear-gradient(160deg,#b6d0cb,#93b6b1)}
.dh-tone--blush{--tile:linear-gradient(160deg,#efc1bb,#e2a29d)}
.dh-tone--plum{--tile:linear-gradient(160deg,#d6aec2,#bf8eab)}

/* Subjects */
.dh-subjects{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.dh-subject{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:3px;padding:8px 8px 9px;border-radius:13px}
.dh-subject img{grid-column:2;grid-row:1;width:22px;height:22px;object-fit:contain}
.dh-subject strong{grid-column:1;grid-row:1;min-height:2.5em;font-size:12.5px;font-weight:900;line-height:1.25;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.dh-subject__meter{grid-column:1/-1;display:flex;align-items:center;gap:6px;margin-top:4px}
.dh-subject__meter .dh-bar{flex:1}
.dh-subject__meter em,.dh-journey__meter em{font-style:normal;font-size:12.5px;font-weight:900;direction:ltr}

/* Journey */
.dh-journey{margin-top:16px;min-height:118px;overflow:hidden;background:#f3dcc0}
.dh-journey__art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:left center}
.dh-journey__body{position:relative;z-index:1;width:62%;margin-inline-start:0;padding:12px 12px 14px;display:grid;gap:4px}
.dh-journey h2{display:flex;align-items:center;gap:6px;margin:0;font-size:22px;font-weight:900}
.dh-journey h2 img{width:30px;height:auto}
.dh-journey p{margin:0;font-size:12.5px;font-weight:700;color:#4b3f3b}
.dh-journey__meter{display:flex;align-items:center;gap:8px;margin-top:6px}
.dh-journey__meter .dh-bar{flex:1;height:13px}
.dh-journey__meter em{font-size:17px}

@media (max-width:420px){.dh-pill img{display:none}}
/* Small phones */
@media (max-width:360px){
  .dh-profile{grid-template-columns:auto minmax(0,1fr) minmax(0,1.1fr);row-gap:6px}
  .dh-profile__badge{display:none}
  .dh-game strong,.dh-subject strong{font-size:12.5px}
  .dh-exam__label{font-size:14px}
}
/* Tablets/desktop: a little more air, same column. */
@media (min-width:600px){
  .dh{--dh-gap:14px}
  .dh-hero{margin:14px 0 0;border-radius:22px}
  .dh-games,.dh-subjects{gap:10px}
  .dh-game{min-height:84px}
}
@media (prefers-reduced-motion:reduce){a.dh-card,.dh-game{transition:none}}

/* Public landing preview */
.dh-login{width:auto;padding:0 16px;font:900 15px/40px var(--dz-font);color:var(--dz-ink) !important;background:var(--dz-cream);border-color:var(--dz-line)}
.dh-demo{position:absolute;top:-11px;left:12px;padding:1px 10px 2px;border-radius:99px;background:var(--dz-gold);border:1.5px solid var(--dz-line);font-size:11px;font-weight:900}
