:root{
  --student-navy:#123f56;
  --student-text:#285568;
  --student-muted:#66818d;
  --student-primary:#119b98;
  --student-primary-dark:#087572;
  --student-accent:#f2b84b;
  --student-border:#d9e8eb;
  --student-surface:#ffffff;
  --student-soft:#f4fafb;
}

.game:has(.student-view.active){
  background:#eaf5f6;
  background-image:linear-gradient(180deg,#d9eef2 0,#f4f9fa 42%,#eaf4f5 100%);
}
.game:has(.student-view.active):before{
  z-index:1;
  background:radial-gradient(circle at 8% 10%,rgba(17,155,152,.09),transparent 25%),radial-gradient(circle at 90% 30%,rgba(242,184,75,.09),transparent 24%);
}
.game:has(.student-view.active):after{display:none}
.student-view.active{position:relative;z-index:3;min-height:calc(100dvh - 100px);padding:28px 20px 60px;color:var(--student-text)}
.student-dashboard{width:min(1100px,100%)!important;margin:auto;gap:18px!important}
.student-view .glass{border:1px solid var(--student-border);background:rgba(255,255,255,.96);box-shadow:0 8px 24px rgba(18,63,86,.08)}

/* Header */
.student-profile-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:"hero actions" "hero level";
  align-items:center!important;
  gap:10px 24px!important;
  min-height:188px;
  padding:26px 28px!important;
  overflow:hidden;
  border-radius:24px!important;
  background:linear-gradient(120deg,#fff 0,#f5fbfb 65%,#eaf7f7 100%)!important;
  box-shadow:0 10px 28px rgba(18,63,86,.1)!important;
}
.student-profile-head:before{content:"";position:absolute;inset:auto -55px -85px auto;width:250px;height:250px;border-radius:50%;background:rgba(17,155,152,.06)}
.student-profile-head:after{content:"";position:absolute;left:18%;top:-65px;width:160px;height:160px;border-radius:50%;background:rgba(242,184,75,.08)}
.student-hero-copy{grid-area:hero;display:flex;align-items:center;gap:20px;min-width:0;z-index:1}
.student-avatar{position:relative;flex:0 0 auto;width:94px!important;height:94px!important;display:grid;place-items:center;border:5px solid #fff!important;border-radius:50%;background:#d9f3f2!important;font-size:52px!important;box-shadow:0 0 0 4px rgba(17,155,152,.15),0 6px 14px rgba(18,63,86,.15)!important}
.student-avatar:after{content:"جاهز";position:absolute;right:-5px;bottom:-5px;padding:3px 9px;border:2px solid #fff;border-radius:99px;background:#35ad65;color:#fff;font-size:9px;font-weight:800;box-shadow:0 2px 6px rgba(18,63,86,.16)}
.student-identity{min-width:0}
.student-identity small{display:block;color:var(--student-primary);font-size:13px!important;font-weight:800!important}
.student-identity h2{margin:3px 0 5px!important;color:var(--student-navy)!important;font-size:clamp(28px,3.2vw,38px)!important;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.student-identity>span{display:inline-flex!important;align-items:center;padding:5px 11px;border-radius:99px;background:#e8f7f6;color:var(--student-primary-dark)!important;font-size:13px!important;font-weight:800}
.student-identity p{margin:9px 0 12px;color:var(--student-muted);font-size:13px;font-weight:600;line-height:1.65}
.student-start-btn{display:inline-flex;align-items:center;gap:9px;min-height:40px;padding:8px 15px;border:0;border-radius:11px;background:var(--student-primary);color:#fff;box-shadow:0 3px 0 var(--student-primary-dark);font-size:13px;font-weight:800;transition:.18s}
.student-start-btn i{font-size:17px;font-style:normal}.student-start-btn:hover{transform:translateY(-2px);background:#0d8f8c}
.student-profile-actions{grid-area:actions;align-self:start;justify-self:end;display:flex;align-items:center;gap:8px;z-index:1}
.student-profile-actions .icon-button{display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--student-border);background:#fff;color:var(--student-text);box-shadow:none;font-size:17px;transition:.18s}
.student-profile-actions .icon-button:hover{background:#f2f7f8;color:var(--student-navy)}
.student-logout-top-btn{position:static!important;min-height:38px!important;margin:0!important;padding:7px 12px!important;border:0!important;border-radius:10px!important;background:#fff0f1!important;color:#b33845!important;font-size:12px!important;box-shadow:none!important}
.student-logout-top-btn:hover{background:#ffe5e7!important}
.student-level{grid-area:level;align-self:end;justify-self:end;min-width:132px!important;padding:12px 15px!important;border:1px solid #f2dda9;border-radius:16px!important;background:#fff9e9!important;text-align:center;box-shadow:none!important;z-index:1}
.student-level small,.student-level span{display:block;color:#80662a;font-size:11px!important;font-weight:700}
.student-level b{display:block;color:#d58a16!important;font-size:34px!important;line-height:1.1}

/* Overview */
.student-overview-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(330px,.85fr);align-items:stretch;gap:18px}
.student-progress-column{display:grid;grid-template-rows:auto auto 1fr;gap:12px;min-width:0}
.account-info-section{height:100%;margin:0!important;padding:20px!important;border-radius:20px!important;background:#fff!important;box-shadow:0 8px 24px rgba(18,63,86,.07)!important}
.account-info-section:before{content:"بيانات الحساب";display:inline-flex;margin-bottom:14px;padding:5px 10px;border-radius:99px;background:#e8f7f6;color:var(--student-primary-dark);font-size:12px;font-weight:800}
.account-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.account-kind{display:flex;align-items:center;gap:11px;min-width:0}.account-kind-icon{display:grid;place-items:center;flex:0 0 auto;width:46px;height:46px;border-radius:13px;background:var(--student-soft);font-size:25px}.account-kind small{display:block;margin-bottom:4px;color:var(--student-muted);font-size:11px;font-weight:700}.account-type-badge{display:inline-flex;max-width:100%;padding:5px 10px;border-radius:99px;background:var(--badge-bg,#fff5d7);color:var(--badge-color,#80560b);font-size:12px;font-weight:800;line-height:1.5}
.account-duration{flex:0 0 auto;padding:7px 10px;border:1px solid var(--student-border);border-radius:11px;background:#fff;text-align:center}.account-duration small,.account-duration b{display:block}.account-duration small{color:var(--student-muted);font-size:10px}.account-duration b{color:var(--student-navy);font-size:11px}.account-duration.active{border-color:#bfe2cb;background:#f3fbf5}.account-duration.urgent{border-color:#f0b9be;background:#fff5f6}
.account-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:12px}.account-fact{min-width:0;padding:10px;border:1px solid var(--student-border);border-radius:11px;background:#fbfdfd}.account-fact small,.account-fact b{display:block}.account-fact small{margin-bottom:4px;color:var(--student-muted);font-size:10px;font-weight:700}.account-fact b{overflow-wrap:anywhere;color:var(--student-navy);font-size:11px;line-height:1.65}
.account-features{padding:11px;border:1px solid var(--student-border);border-radius:12px;background:var(--student-soft)}.account-features>small{display:block;margin-bottom:7px;color:var(--student-muted);font-size:11px;font-weight:700}.account-feature-list{display:flex;flex-wrap:wrap;gap:6px}.account-feature{display:inline-flex;gap:5px;padding:5px 7px;border-radius:8px;background:#fff;color:var(--student-text);font-size:10px;font-weight:600;line-height:1.6}.account-feature i{color:#239653;font-style:normal;font-weight:900}
.account-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.account-action{display:flex;align-items:center;justify-content:center;min-height:38px;padding:7px 10px;border-radius:10px;color:#fff;text-align:center;text-decoration:none;font-size:11px;font-weight:800}.account-action.portal{background:#287f9a}.account-action.whatsapp{background:#27965b}

.level-progress{padding:18px!important;border-radius:18px!important;background:#fff!important}.level-progress>div:first-child{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:11px!important}.level-progress b{color:var(--student-navy);font-size:15px}.level-progress span{color:var(--student-muted);font-size:12px!important;font-weight:700}
.student-progress-track{height:10px!important;overflow:hidden;border:0!important;border-radius:99px;background:#dcebed!important;box-shadow:none!important}.student-progress-track i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--student-primary),#54bd7c)!important;box-shadow:none!important;transition:width .45s}
.student-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:9px!important}.student-stat{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:2px!important;min-height:92px;padding:12px!important;border:1px solid var(--student-border)!important;border-radius:16px!important;background:#fff!important;text-align:center;box-shadow:0 5px 14px rgba(18,63,86,.06)!important}.student-stat span{font-size:25px!important;line-height:1.1}.student-stat b{color:var(--student-navy)!important;font-size:21px!important;line-height:1.2}.student-stat small{color:var(--student-muted);font-size:11px!important;font-weight:700}
.daily-mission-card{display:grid;grid-template-columns:auto 1fr auto!important;align-items:center;gap:13px!important;min-height:100%;padding:17px 18px!important;border:1px solid #e7dfc6!important;border-radius:18px!important;background:#fffbef!important;box-shadow:0 5px 14px rgba(18,63,86,.05)!important}.mission-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:13px;background:#fff3ce;font-size:26px!important}.daily-mission-card small{display:block;color:#8a7137;font-size:11px!important;font-weight:800}.daily-mission-card h3{margin:2px 0 8px;color:var(--student-navy);font-size:14px}.daily-mission-card>div:nth-child(2)>span{display:block;margin-top:6px;color:var(--student-muted);font-size:11px!important;font-weight:700}.mission-prize{padding:6px 9px!important;border-radius:10px!important;background:var(--student-accent)!important;color:#6c4b0c;font-size:11px;box-shadow:none!important;white-space:nowrap}

/* Sections */
.student-section{padding:21px!important;border-radius:20px!important;background:#fff!important;box-shadow:0 8px 24px rgba(18,63,86,.07)!important}.student-section>header{display:flex;justify-content:space-between;align-items:center!important;gap:12px;margin-bottom:16px!important;padding-bottom:13px;border-bottom:1px solid var(--student-border)}.student-section>header small{display:block;margin-bottom:2px;color:var(--student-primary);font-size:11px!important;font-weight:800}.student-section h3{margin:0;color:var(--student-navy);font-size:18px}.student-section>header>span{padding:5px 9px;border-radius:99px;background:var(--student-soft)!important;color:var(--student-muted);font-size:11px!important;font-weight:800}
.student-tables{display:grid;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:10px!important}.student-tables button{min-width:0;min-height:92px!important;border:1px solid var(--student-border)!important;border-radius:15px!important;background:#f7fbfb!important;color:var(--student-navy)!important;box-shadow:none!important;transition:.18s}.student-tables button:hover:not(:disabled){transform:translateY(-2px);border-color:#8fc9ca!important;background:#eff9f8!important}.student-tables button b,.student-tables button span{display:block}.student-tables button b{font-size:26px!important}.student-tables button span{color:var(--student-muted);font-size:10px!important;font-weight:700}.student-tables button.mastered{border-color:#aad8bc!important;background:#edf9f1!important;color:#227447!important;box-shadow:none!important}.student-tables button.mastered b{color:#227447!important}.student-tables button.mastery-5{border-color:#ecd18d!important;background:#fff8e5!important;color:#8b6416!important}.student-tables button.locked{opacity:.48;filter:grayscale(.7);box-shadow:none!important}
.mastery-stars{direction:ltr;display:flex!important;justify-content:center;gap:1px}.mastery-stars i{font-size:12px!important}.student-tables button.mastered span small{margin-top:4px!important;padding:0!important;background:transparent!important;color:var(--student-muted)!important;font-size:9px!important}
.student-badges{display:grid;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:10px!important}.student-badges article{min-width:0;min-height:108px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px 7px!important;border:1px solid var(--student-border)!important;border-radius:15px!important;background:#fbfdfd!important;text-align:center;box-shadow:none!important}.student-badges span{font-size:32px!important}.student-badges b{color:var(--student-navy);font-size:11px!important}.student-badges small{color:var(--student-muted);font-size:10px!important}.student-badges .earned{border-color:#edd392!important;background:#fff9e9!important;box-shadow:none!important}.student-badges .locked{opacity:.45;filter:grayscale(1)}
.student-badges .live-achievement{grid-column:span 2;min-height:122px!important;border:3px solid #f2c84d!important;border-radius:22px!important;background:linear-gradient(145deg,#fffce8,#fff0a7)!important;box-shadow:0 5px 0 #c58b22,0 10px 22px #8b621a22!important}.student-badges .live-achievement span{filter:drop-shadow(0 4px 3px #8b621a44)}.student-badges .live-achievement b{font-size:13px!important}.student-badges .live-achievement small{max-width:260px;line-height:1.65;font-weight:800}
.student-lower-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(260px,.75fr)!important;gap:18px!important}.recent-rounds{display:grid;gap:8px}.recent-rounds article{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:11px;padding:11px 12px!important;border:1px solid var(--student-border);border-radius:11px!important;background:#fbfdfd!important}.recent-rounds article>span{font-size:24px!important}.recent-rounds b{color:var(--student-navy);font-size:12px}.recent-rounds small{color:var(--student-muted);font-size:10px!important}.recent-rounds strong{color:#25824c;font-size:12px}.empty-history{text-align:center;color:var(--student-muted);font-size:13px}
.next-reward{display:flex;flex-direction:column;justify-content:center;padding:21px!important;border-radius:20px!important;background:#f6f1ff!important;text-align:center}.next-reward>span{display:block;font-size:48px!important}.next-reward small{display:block;color:#766a8b;font-size:11px;font-weight:800}.next-reward h3{margin:5px;color:#514765;font-size:18px}.next-reward p{color:#766a8b;font-size:12px!important;font-weight:600}

/* Keep certificates compact inside the dashboard; print design remains unchanged. */
.student-view .student-certificates{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.student-view .student-certificate{min-height:270px!important;padding:20px!important;border:3px double #9bc7ca!important;border-radius:16px!important;background:#f8fbfa!important;color:var(--student-text)!important;box-shadow:none!important}.student-view .student-certificate:before,.student-view .student-certificate:after{display:none!important}.student-view .certificate-brand{font-size:11px}.student-view .certificate-ribbon{margin:6px auto 2px;padding:4px 17px;font-size:10px}.student-view .student-certificate .certificate-seal{margin-top:5px;font-size:34px}.student-view .student-certificate>small{font-size:11px}.student-view .student-certificate h4{margin:4px 0;font-size:12px}.student-view .student-certificate h4 strong{font-size:20px}.student-view .student-certificate p{margin:5px;font-size:13px}.student-view .student-certificate>span{font-size:10px}.student-view .student-certificate em{margin-top:7px;font-size:13px}.student-view .certificate-footer{margin-top:10px}.student-view .certificate-footer>div{font-size:8px}.student-view .certificate-footer .achievement-stamp{width:50px;height:50px;min-width:50px;font-size:8px}.student-view .student-certificate .print-certificate{margin-top:9px;padding:8px 15px;background:var(--student-primary);box-shadow:none}

.student-tables button:focus-visible,.student-start-btn:focus-visible,.student-profile-actions button:focus-visible{outline:3px solid var(--student-accent);outline-offset:3px}

@media(max-width:980px){
  .student-overview-layout{grid-template-columns:1fr}
  .student-progress-column{grid-template-columns:1fr 1fr;grid-template-rows:auto auto}
  .level-progress{grid-column:1/-1}.daily-mission-card{grid-column:1}.student-stat-grid{grid-column:2;grid-row:2}
  .student-tables{grid-template-columns:repeat(4,minmax(0,1fr))!important}.student-badges{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}

@media(max-width:700px){
  .student-view.active{padding:12px 9px 36px}
  .student-dashboard{gap:13px!important}
  .student-profile-head{grid-template-columns:1fr auto!important;grid-template-areas:"actions actions" "hero level";min-height:0;padding:15px!important;border-radius:18px!important}
  .student-profile-actions{position:static;justify-self:end;flex-direction:row-reverse}
  .student-hero-copy{gap:12px}.student-avatar{width:68px!important;height:68px!important;font-size:38px!important;border-width:3px!important}.student-avatar:after{font-size:7px}
  .student-identity small{font-size:11px!important}.student-identity h2{font-size:24px!important}.student-identity>span{padding:4px 8px;font-size:11px!important}.student-identity p{margin:6px 0 9px;font-size:11px}.student-start-btn{min-height:36px;padding:7px 11px;font-size:11px}
  .student-level{min-width:82px!important;padding:8px!important}.student-level b{font-size:27px!important}.student-level small,.student-level span{font-size:9px!important}
  .student-progress-column{grid-template-columns:1fr;grid-template-rows:auto}.level-progress,.daily-mission-card,.student-stat-grid{grid-column:auto;grid-row:auto}
  .account-info-section,.student-section{padding:15px!important;border-radius:16px!important}.account-card-head{align-items:flex-start}.account-facts{grid-template-columns:1fr}.account-actions{grid-template-columns:1fr}
  .student-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.daily-mission-card{grid-template-columns:auto 1fr!important}.mission-prize{grid-column:1/-1;justify-self:center}
  .student-tables{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:7px!important}.student-tables button{min-height:82px!important}.student-badges{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important}
  .student-lower-grid{grid-template-columns:1fr!important}.student-view .student-certificates{grid-template-columns:1fr}
}

@media(max-width:430px){
  .student-profile-head{grid-template-columns:1fr!important;grid-template-areas:"actions" "hero" "level";text-align:right}
  .student-hero-copy{flex-direction:row}.student-identity h2{white-space:normal}.student-level{justify-self:stretch;width:100%!important;display:flex!important;align-items:center;justify-content:center;gap:7px}
  .account-card-head{flex-direction:column}.account-duration{width:100%}
  .student-tables{grid-template-columns:repeat(3,minmax(0,1fr))!important}.student-badges{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .student-section>header{align-items:flex-start!important}.student-section h3{font-size:16px}
}

@media(prefers-reduced-motion:reduce){.student-view *{transition:none!important}}
