/* Integração visual da entrada do AliFun com o dashboard do Aluno.
   Não afeta a página de jogo (overlay fullscreen), API, subscrição ou recompensas. */
body.aliplay-student-integrated > .wrap {
  max-width:1240px; /* preserva a grelha original do arcade, não os 900px de outros módulos */
  width:calc(100% - 32px);
  margin-left:auto;
  margin-right:auto;
  padding-left:0;
  padding-right:0;
}
body.aliplay-student-integrated > .userbar-wrap {
  max-width:1240px;
  width:calc(100% - 32px);
  margin-left:auto;
  margin-right:auto;
  padding-left:0;
  padding-right:0;
}
/* Quando o utilizador termina sessão ou fica no ecrã da subscrição,
   não apresentar navegação da sessão anterior. */
body:not(.aliplay-student-integrated) > #aliplay-student-sidebar,
body:not(.aliplay-student-integrated) > .aliplay-student-mobiletop,
body:not(.aliplay-student-integrated) > .aliplay-student-scrim {display:none!important;}
/* O player de cada jogo continua a sobrepor-se ao dashboard, mesmo em mobile. */
body.aliplay-student-integrated .overlay {z-index:9999;}
@media(max-width:820px) {
  body.aliplay-student-integrated > .wrap,
  body.aliplay-student-integrated > .userbar-wrap {width:calc(100% - 24px);}
  body.aliplay-student-integrated .header-user-bar {
    flex-wrap:wrap;gap:8px 12px;padding:10px 12px;min-width:0;
  }
  body.aliplay-student-integrated .header-user-bar .validade {
    margin-left:0;white-space:normal;overflow-wrap:anywhere;
  }
  body.aliplay-student-integrated .header-user-bar .saldo {font-size:14px;padding:6px 10px;}
  body.aliplay-student-integrated .header-user-bar .logout-btn {margin-left:auto;}
  body.aliplay-student-integrated .hero-copy,
  body.aliplay-student-integrated .hero-stats {min-width:0;}
}
@media(max-width:480px) {
  body.aliplay-student-integrated .wrap {margin-top:12px;}
  body.aliplay-student-integrated .hero-copy,
  body.aliplay-student-integrated .hero-stats {padding:15px;}
  body.aliplay-student-integrated .brand {align-items:flex-start;}
  body.aliplay-student-integrated .brand h1 {font-size:clamp(24px,7vw,31px);}
  body.aliplay-student-integrated .daily-tokens-card {min-width:0;}
  body.aliplay-student-integrated .bar input,
  body.aliplay-student-integrated .bar select {width:100%;min-width:0;}
  body.aliplay-student-integrated .game-grid {grid-template-columns:minmax(0,1fr);}
}

/* AliFun 7.5.8.56 — entrada mais clara e coerente com o ecossistema AliPlay.
   Mantém os cartões dos jogos com identidade arcade e não altera o player fullscreen. */
body.aliplay-student-integrated:not(.game-open) {
  background:
    radial-gradient(900px 560px at 8% -8%, rgba(71,211,232,.18) 0%, transparent 68%),
    radial-gradient(820px 520px at 96% 6%, rgba(113,94,255,.12) 0%, transparent 70%),
    linear-gradient(180deg,#f7fcff 0%,#eef8fb 54%,#f7fbff 100%);
  color:#112b47;
}
body.aliplay-student-integrated:not(.game-open) > .stars {
  opacity:.09;
  mix-blend-mode:multiply;
  background-image:radial-gradient(#3f9fbe 0.7px, transparent 0.7px);
  background-size:4px 4px;
}

body.aliplay-student-integrated .header-user-bar {
  background:rgba(255,255,255,.92);
  color:#173452;
  border:1px solid #d4e8f1;
  box-shadow:0 10px 28px rgba(29,91,122,.10);
  backdrop-filter:blur(12px);
}
body.aliplay-student-integrated .header-user-bar .saldo {
  background:#e8fbfd;
  color:#087f91;
  border:1px solid #bdebf0;
}
body.aliplay-student-integrated .header-user-bar .validade {
  color:#176e83;
  background:#eef9fc;
}
body.aliplay-student-integrated .header-user-bar .logout-btn {
  background:#fff;
  border-color:#a9d7e5;
  color:#27567a;
}
body.aliplay-student-integrated .header-user-bar .logout-btn:hover {
  background:#edf9fd;
  color:#123f62;
}

body.aliplay-student-integrated .hero-copy,
body.aliplay-student-integrated .hero-stats {
  background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(242,251,255,.94));
  border-color:#cfe5ef;
  box-shadow:0 18px 45px rgba(38,94,126,.11),0 0 0 1px rgba(255,255,255,.75) inset;
}
body.aliplay-student-integrated .logo {
  background:radial-gradient(circle at 35% 28%,#dfffff 0%,#4fd6ea 38%,#3f69db 76%,#24365d 100%);
  box-shadow:0 12px 25px rgba(28,145,183,.20),0 0 22px rgba(255,255,255,.55) inset;
}
body.aliplay-student-integrated .eyebrow {color:#00a9bb;}
body.aliplay-student-integrated h1 {color:#132b49;}
body.aliplay-student-integrated .tagline {color:#42647b;}
body.aliplay-student-integrated .edu-note {
  background:linear-gradient(135deg,#effcff,#f4fbff);
  border-color:#bfeaf0;
  color:#355970;
}
body.aliplay-student-integrated .stat-card {
  border-color:#d2e7f0;
  background:linear-gradient(145deg,#ffffff,#f0f9fd);
  box-shadow:0 8px 18px rgba(37,102,132,.07);
}
body.aliplay-student-integrated .stat-card strong {color:#00a9bb;}
body.aliplay-student-integrated .stat-card span {color:#4f6879;}

body.aliplay-student-integrated .daily-tokens-card {
  border-color:#b9e3ea;
  background:linear-gradient(135deg,#f2feff,#edf8ff);
  color:#183550;
  box-shadow:0 12px 30px rgba(33,103,131,.09),0 0 0 1px rgba(255,255,255,.8) inset;
}
body.aliplay-student-integrated .daily-tokens-card .label {color:#43809a;}
body.aliplay-student-integrated .daily-tokens-card .hint {color:#4a697d;}
body.aliplay-student-integrated .daily-tokens-card .value {color:#7a56d8;}
body.aliplay-student-integrated .daily-tokens-card .meter {
  background:#dfeff4;
  border-color:#c5dde7;
}
body.aliplay-student-integrated .rules-btn {
  border-color:#65bfd2;
  background:linear-gradient(135deg,#ffffff,#eaf9fc);
  color:#244c72;
  box-shadow:0 12px 30px rgba(33,103,131,.09);
}
body.aliplay-student-integrated .rules-btn:hover {
  border-color:#22afc5;
  background:linear-gradient(135deg,#f5fdff,#def6fb);
  color:#123b5c;
}

body.aliplay-student-integrated .bar {
  background:rgba(255,255,255,.88);
  border-color:#d1e5ee;
  box-shadow:0 10px 26px rgba(31,87,117,.07);
}
body.aliplay-student-integrated .bar input,
body.aliplay-student-integrated .bar select {
  background:#fbfeff;
  border-color:#cbdfe8;
  color:#173650;
}
body.aliplay-student-integrated .bar input::placeholder {color:#7891a0;}
body.aliplay-student-integrated .muted {color:#587286;}
body.aliplay-student-integrated .filters .label {color:#536f82;}
body.aliplay-student-integrated .pill {
  background:#f5fbfe;
  border-color:#c7dfe9;
  color:#375a72;
}
body.aliplay-student-integrated .pill:hover {
  border-color:#51bfd0;
  color:#0c7081;
}
body.aliplay-student-integrated .pill.active {
  background:#e8f8fb;
  border-color:#59bfd1;
  box-shadow:0 0 0 2px rgba(79,197,215,.13) inset;
  color:#166b7c;
}
body.aliplay-student-integrated .objective-head h2 {color:#163651;}
body.aliplay-student-integrated .objective-head p {color:#587286;}
body.aliplay-student-integrated .objective-count {
  color:#087f91;
  border-color:#b9dfe8;
  background:#f7fdff;
}

/* Cartões: deliberadamente mais escuros que o resto da página para preservar a sensação de arcade. */
body.aliplay-student-integrated .card {
  background:linear-gradient(180deg,#173a5b 0%,#102c49 100%);
  border-color:#2b6887;
  box-shadow:0 12px 28px rgba(22,63,92,.16);
  color:#f4fbff;
}
body.aliplay-student-integrated .card:hover {
  box-shadow:0 19px 38px rgba(28,83,116,.23),0 0 0 1px rgba(45,235,240,.18) inset;
  border-color:#42bfd3;
}
body.aliplay-student-integrated .thumb {
  background:
    radial-gradient(110px 74px at 55% 45%,#41f0ed 0%,#1687aa 43%,#174365 75%),
    radial-gradient(160px 90px at 28% 68%,#316da0 0%,transparent 64%);
}
body.aliplay-student-integrated .badge {
  background:rgba(19,53,82,.92);
  border-color:#4a86a7;
  color:#e9fbff;
}
body.aliplay-student-integrated .difficulty {
  background:rgba(18,48,76,.9);
  border-color:#4b90aa;
  color:#e1f9ff;
}
body.aliplay-student-integrated .category-pill {
  color:#68f2f2;
  background:#133654;
  border-color:#2c6d8d;
}
body.aliplay-student-integrated .meta p {color:#d0e2ec;}
body.aliplay-student-integrated .info-chip {
  border-color:#315f7a;
  background:#12334f;
  color:#eff9ff;
}
body.aliplay-student-integrated .info-chip b {color:#8ed4e7;}
body.aliplay-student-integrated .skill-box {
  border-color:#2b7280;
  background:rgba(38,203,202,.10);
  color:#edffff;
}
body.aliplay-student-integrated .best-score.empty {
  border-color:#315f7a;
  background:#12334f;
  color:#d5eaf4;
}
body.aliplay-student-integrated .best-score.empty span {color:#94cfe0;}
body.aliplay-student-integrated .best-score.empty b {color:#bed4df;}
body.aliplay-student-integrated .play-cta {
  border-color:#37aac8;
  background:linear-gradient(135deg,#31a9e8,#20d0c4);
  color:#08253a;
  box-shadow:0 7px 18px rgba(20,171,194,.18);
}
body.aliplay-student-integrated footer {color:#6d8798;}
body.aliplay-student-integrated .empty {
  color:#587286;
  border-color:#bfd7e2;
  background:#f8fdff;
}
body.aliplay-student-integrated .skeleton {
  background:linear-gradient(90deg,#eef7fa,#dfeff5,#eef7fa);
}

/* A janela explicativa acompanha o novo tom claro; o jogo fullscreen continua escuro. */
body.aliplay-student-integrated .rules-backdrop {background:rgba(24,44,67,.48);}
body.aliplay-student-integrated .rules-card {
  background:linear-gradient(180deg,#ffffff,#f2faff);
  border-color:#b8dce7;
  box-shadow:0 28px 80px rgba(23,55,84,.28);
  color:#173650;
}
body.aliplay-student-integrated .rules-card header {
  border-color:#d3e7ef;
  background:linear-gradient(90deg,#f5fcff,#e9f8fc);
}
body.aliplay-student-integrated .rules-card h2 {color:#173650;}
body.aliplay-student-integrated .rules-close {
  border-color:#b7d7e2;
  background:#fff;
  color:#315972;
}
body.aliplay-student-integrated .rules-body p {color:#4b687b;}
body.aliplay-student-integrated .rule-item {
  border-color:#cde2ea;
  background:#f7fcfe;
}
body.aliplay-student-integrated .rule-item strong {
  background:#eaf6fb;
  color:#6d50cd;
}
body.aliplay-student-integrated .rule-item b {color:#173650;}
body.aliplay-student-integrated .rule-item span {color:#526f81;}
body.aliplay-student-integrated .rules-note {
  border-color:#bde2c9;
  background:#f0fbf4;
  color:#37614a;
}

/* AliFun 7.5.8.57 — o fundo claro acompanha toda a altura do catálogo.
   A folha base define body com height:100%; em páginas longas isso deixava o fundo
   original escuro reaparecer abaixo da primeira altura do ecrã. */
body.aliplay-student-integrated:not(.game-open) {
  height:auto;
  min-height:100vh;
  background-color:#f4fbfd;
}
