/* دروسي home-preview — shared */




:root {
  --field: #16338f;
  --field-deep: #0c1f63;
  --ink-dark: #2b1d00;
  --white: #ffffff;
  --soft: rgba(255,255,255,.78);
  --radius: 26px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--white);
  font-family: system-ui, "Segoe UI", Tahoma, system-ui, sans-serif; font-weight: 500;
  background:
    radial-gradient(120% 55% at 50% -8%, rgba(140,180,255,.55) 0%, rgba(80,120,240,.18) 45%, transparent 70%),
    radial-gradient(60% 40% at 100% 40%, rgba(124,58,237,.22), transparent 70%),
    linear-gradient(180deg, #1f45b0 0%, var(--field) 38%, var(--field-deep) 100%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
main { width: 100%; max-width: 680px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 16px 40px; }

header.hero { position: relative; text-align: center; padding: 18px 16px 16px; }
header.hero h1 { margin: 0; padding: 0 78px; min-height: 96px; display: grid; place-items: center;
  font-weight: 800; font-size: clamp(46px, 13vw, 64px); line-height: 1.15;
  text-shadow: 0 4px 0 rgba(8,20,70,.35), 0 0 28px rgba(150,190,255,.45); }
header.hero p { margin: 4px 12px 0; color: var(--soft); font-size: 16px; font-weight: 500; position: relative; z-index: 1; }
.mascot { position: absolute; top: 10px; height: auto; pointer-events: none; user-select: none;
  filter: drop-shadow(0 8px 12px rgba(5,15,60,.45)); }
.mascot.toya { right: 0; width: 78px; }
.mascot.reesho { left: 0; width: 80px; }

.panel {
  position: relative; margin-top: 6px; padding: 20px 14px 24px; border-radius: 32px;
  background:
    radial-gradient(90% 40% at 50% 0%, rgba(140,180,255,.28), transparent 70%),
    linear-gradient(180deg, #2a5ddc 0%, #1c46b8 42%, #153a99 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset 0 2px 0 rgba(255,255,255,.2),
              0 22px 50px rgba(3,10,45,.5), 0 0 44px rgba(90,140,255,.22);
}
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 6px 14px; }
.panel-head h2 { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.2;
  text-shadow: 0 3px 0 rgba(8,20,70,.3), 0 0 18px rgba(160,195,255,.35); }
.panel-head .pill { font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); color: #fff; }
.panel-hint { margin: -4px 8px 14px; color: var(--soft); font-size: 13.5px; font-weight: 500; }

.group-label {
  grid-column: 1 / -1; margin: 10px 4px 0; font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,.7);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wide { grid-column: 1 / -1; }

.card {
  --c1: #a855f7; --c2: #7c3aed; --ledge: #5b21b6; --txt: #fff; --sub: rgba(255,255,255,.86); --halo: rgba(168,85,247,.35);
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 4px;
  min-height: 118px; padding: 16px 16px 15px 16px;
  border-radius: var(--radius); text-decoration: none; color: var(--txt);
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 6px 0 var(--ledge), 0 14px 28px rgba(4,12,50,.38), 0 0 26px var(--halo),
              inset 0 2px 0 rgba(255,255,255,.45), inset 0 -10px 24px rgba(0,0,0,.08);
  transition: transform .18s ease, box-shadow .18s ease;
  isolation: isolate; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 55% 0; border-radius: inherit; z-index: -1;
  background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0));
}
.card:hover { transform: translateY(-2px); }
.card:active { transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ledge), 0 8px 18px rgba(4,12,50,.35), 0 0 22px var(--halo), inset 0 2px 0 rgba(255,255,255,.45); }
.card b { display: block; font-weight: 800; font-size: 20px; line-height: 1.35; }
.card small { display: block; font-size: 13.5px; line-height: 1.55; color: var(--sub); font-weight: 500; }

/* Grade / subject cards: number or hero on the right, no overlapping arrow on the title */
.card.island {
  flex-direction: row; align-items: center; gap: 12px;
  padding: 14px 14px 14px 14px; min-height: 108px;
}
.card.island .txt { flex: 1; min-width: 0; }
.card.island b { font-size: 19px; }
.badge {
  flex: none; width: 48px; height: 48px; border-radius: 16px;
  display: grid; place-items: center; font-weight: 800; font-size: 22px;
  background: rgba(255,255,255,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.peek {
  flex: none; width: 68px; height: 78px; object-fit: contain; object-position: bottom center;
  filter: drop-shadow(0 6px 8px rgba(0,0,20,.35));
  margin: -10px -2px -20px;
  background: none;
}
.peek.sm { width: 44px; height: 52px; margin: -6px -6px -14px 0; }
.peek.portrait {
  width: 56px; height: 68px; object-fit: cover; object-position: top center;
  border-radius: 16px; margin: -6px 0 -10px;
  box-shadow: 0 4px 10px rgba(0,0,20,.25);
}
.duo { display: flex; align-items: flex-end; flex: none; margin-inline-start: -6px; }

.gold   { --c1: #fff1b0; --c2: #f9cf4a; --ledge: #d9a21a; --txt: var(--ink-dark); --sub: #5c4300; --halo: rgba(255,214,90,.45); }
.gold .badge { background: rgba(255,255,255,.65); }
.purple { --c1: #b46cf9; --c2: #7c3aed; --ledge: #5b21b6; --halo: rgba(168,85,247,.38); }
.blue   { --c1: #3cc8f5; --c2: #0e8ad6; --ledge: #0a62a0; --halo: rgba(60,200,245,.35); }
.coral  { --c1: #ff8a73; --c2: #e8455f; --ledge: #b02c45; --halo: rgba(255,120,120,.3); }
.green  { --c1: #5cc94a; --c2: #2c9431; --ledge: #1f6e24; --halo: rgba(120,220,100,.3); }
.teal   { --c1: #2ad4c1; --c2: #0f9a8a; --ledge: #0b6e63; --halo: rgba(42,212,193,.32); }
.pink   { --c1: #ff7ab6; --c2: #e4468b; --ledge: #b02c68; --halo: rgba(255,122,182,.32); }

/* Treasure strip */
.treasure {
  margin-top: 18px; padding: 18px 12px 16px; border-radius: 28px;
  background:
    radial-gradient(80% 50% at 50% 0%, rgba(255,230,140,.28), transparent 70%),
    linear-gradient(180deg, #3a2a12 0%, #5a3d16 40%, #2a1c0c 100%);
  box-shadow: inset 0 0 0 1px rgba(255,214,90,.25), inset 0 2px 0 rgba(255,240,180,.18),
              0 16px 36px rgba(20,10,0,.35);
}
.treasure h3 {
  margin: 0 8px 6px; font-size: 22px; font-weight: 800; color: #ffe08a;
  text-shadow: 0 2px 0 rgba(60,30,0,.45);
}
.treasure .lead { margin: 0 8px 14px; color: rgba(255,236,190,.8); font-size: 13.5px; }
.chest-block { margin: 0 0 14px; }
.chest-block:last-child { margin-bottom: 0; }
.chest-block h4 {
  margin: 0 8px 8px; font-size: 14px; font-weight: 800; color: #ffe9b0;
  display: flex; align-items: center; gap: 8px;
}
.chest-block h4::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ffd75e; box-shadow: 0 0 8px rgba(255,215,94,.7); }

/* Grade page top bar */
.topbar {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 4px 0;
}
.topbar a.back {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; text-decoration: none;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.2);
  font-size: 22px; font-weight: 800;
}
.topbar .who { flex: 1; min-width: 0; }
.topbar h1 { margin: 0; font-size: clamp(26px, 7vw, 34px); font-weight: 800; line-height: 1.2;
  text-shadow: 0 3px 0 rgba(8,20,70,.3); }
.topbar p { margin: 2px 0 0; color: var(--soft); font-size: 14px; }

.more, .teacher {
  margin: 26px 6px 0; padding: 14px; border-radius: 20px;
  background: rgba(5,14,55,.3); border: 1px solid rgba(255,255,255,.1);
}
.more h2, .teacher h2 { margin: 0 2px 10px; font-size: 15px; font-weight: 700; color: var(--soft);
  display: flex; align-items: center; gap: 8px; }
.more h2::before, .teacher h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ffd75e; box-shadow: 0 0 8px rgba(255,215,94,.7); }
.tlinks { display: flex; flex-wrap: wrap; gap: 8px; }
.tlinks a {
  display: inline-flex; align-items: center; text-decoration: none; min-height: 40px;
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
}
.tlinks a:hover { background: rgba(255,255,255,.15); }

.study { flex-direction: column !important; align-items: stretch !important; min-height: 0; }
.study .row { display: flex; align-items: center; gap: 12px; }
.study .main { text-decoration: none; color: inherit; flex: 1; }
.study .main::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; position: relative; z-index: 2; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 9px 15px; min-height: 40px; border-radius: 999px; color: var(--ink-dark);
  background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.15);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #3fae3a; }
.chip.math .dot { background: #7c3aed; }
.ico {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: rgba(255,255,255,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
.ico svg { width: 21px; height: 21px; }
.gold .ico { background: rgba(255,255,255,.6); }

footer { text-align: center; color: rgba(255,255,255,.5); font-size: 12.5px; margin-top: 26px; }
a:focus-visible, button:focus-visible { outline: 3px solid #ffe08a; outline-offset: 3px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes bob  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.grid > * { animation: rise .5s ease backwards; }
.grid > .group-label { animation: none; }
.grid > *:nth-child(2) { animation-delay: .04s } .grid > *:nth-child(3) { animation-delay: .08s }
.grid > *:nth-child(4) { animation-delay: .12s } .grid > *:nth-child(5) { animation-delay: .16s }
.grid > *:nth-child(6) { animation-delay: .2s }  .grid > *:nth-child(7) { animation-delay: .24s }
.grid > *:nth-child(n+8) { animation-delay: .28s }
.mascot.toya { animation: bob 5s ease-in-out infinite; }
.mascot.reesho { animation: bob 5s ease-in-out 1.2s infinite; }
.peek { animation: bob 4.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (min-width: 560px) {
  main { padding-top: 36px; }
  .mascot.toya { width: 96px; } .mascot.reesho { width: 98px; }
  .panel { padding: 24px 22px 28px; }
  .grid { gap: 16px; }
  .card b, .card.island b { font-size: 21px; }
}
@media (max-width: 430px) {
  header.hero h1 { padding: 0 70px; }
  header.hero p { font-size: 14px; }
  .mascot.toya { width: 66px; } .mascot.reesho { width: 68px; }
  .card.island b { font-size: 17px; }
  .card.island small { font-size: 12.5px; }
  .badge { width: 44px; height: 44px; font-size: 20px; }
  .peek { width: 56px; height: 64px; }
}
@media (max-width: 360px) {
  header.hero h1 { padding: 0 62px; font-size: 42px; }
  .mascot.toya { width: 56px; } .mascot.reesho { width: 58px; }
  .grid { gap: 12px; }
  .panel { padding-inline: 10px; } .panel-head h2 { font-size: 24px; }
}
