/* Mobile-first dashboard promotion: visual hierarchy, fewer competing actions, larger touch targets. */

:root {
  --dashboard-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dashboard-spring: cubic-bezier(0.18, 0.9, 0.24, 1.18);
  --dashboard-glow: 0 18px 44px rgba(109, 93, 252, 0.22);
}

.student-dashboard-live {
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 209, 102, 0.34), transparent 24rem),
    radial-gradient(circle at 94% 8%, rgba(67, 211, 158, 0.18), transparent 24rem),
    linear-gradient(160deg, #fff8ec 0%, #effcff 48%, #fff4fb 100%);
}

.student-dashboard-live #student-root header {
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.76);
}

.student-dashboard-live #student-root header nav {
  display: none !important;
}

.student-dashboard-live #student-root header button,
.student-dashboard-live #student-root header a,
.student-dashboard-live #student-root main a,
.student-dashboard-live #student-root main button {
  min-height: 44px;
}

.student-dashboard-live #student-root main {
  max-width: 920px;
  gap: 1rem;
  padding-top: 0.9rem;
}

.student-dashboard-live #student-root main > section:first-of-type {
  min-height: min(72svh, 660px);
  border-radius: 2.25rem;
  box-shadow: 0 26px 70px rgba(39, 32, 91, 0.22);
}

.student-dashboard-live #student-root main > section:first-of-type h1 {
  max-width: 9ch;
  font-size: clamp(3.15rem, 15vw, 5.8rem);
}

.student-dashboard-live #student-root main > section:first-of-type a[href*="Games.html"] {
  display: none !important;
}

.student-dashboard-live #student-root main > section:first-of-type a[href*="test/"],
.student-dashboard-live #student-root main > section:first-of-type a[href*="student-session"],
.student-dashboard-live #student-root main > section:first-of-type a[href*="student-test"] {
  min-height: 4.2rem;
  border-radius: 1.5rem;
  font-size: 1.16rem;
}

.student-dashboard-live #student-root main > section:nth-of-type(2) > div:first-child a {
  display: none !important;
}

.student-dashboard-live #student-root main > section:nth-of-type(2) > div:last-child {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 82%);
  grid-template-columns: none !important;
  gap: 0.85rem;
  overflow-x: auto;
  padding: 0.1rem 0.1rem 0.8rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.student-dashboard-live #student-root main > section:nth-of-type(2) > div:last-child::-webkit-scrollbar {
  display: none;
}

.student-dashboard-live #student-root main > section:nth-of-type(2) > div:last-child > a {
  min-height: 13.5rem !important;
  scroll-snap-align: start;
}

.student-dashboard-live #student-root main > section:nth-of-type(3) {
  border-radius: 2rem;
}

.student-dashboard-live #student-root main > div,
.student-dashboard-live #student-root main > section:nth-of-type(n + 4) {
  scroll-margin-top: 5rem;
}

.student-dashboard-live #student-root [class*="bottom-0"] {
  border-top: 0;
  background: rgba(255, 255, 255, 0.88);
}

.parent-dashboard-live {
  background:
    radial-gradient(circle at 8% 4%, rgba(245, 166, 35, 0.18), transparent 22rem),
    radial-gradient(circle at 92% 8%, rgba(45, 122, 107, 0.13), transparent 24rem),
    #f7f5ef;
}

.parent-dashboard-live .main-content {
  padding-top: 22px;
}

.parent-dashboard-live .parent-workspace {
  gap: 16px;
}

.parent-dashboard-live .plan-access-panel {
  margin-bottom: 14px;
  border-radius: 18px;
}

.parent-dashboard-live .parent-summary-hero,
.parent-dashboard-live .dashboard-panel,
.parent-dashboard-live .confidence-item,
.parent-dashboard-live .decision-card {
  border-radius: 18px;
}

.parent-dashboard-live .parent-summary-hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(230, 245, 241, 0.78)),
    #fff;
}

.parent-dashboard-live .parent-summary-hero h2 {
  max-width: 12ch;
  font-family: var(--font-sans);
  font-size: clamp(2.25rem, 7vw, 4rem);
  font-weight: 800;
  line-height: 0.98;
}

.parent-dashboard-live .parent-summary-hero .hero-actions,
.parent-dashboard-live .parent-confidence-strip .confidence-item.primary .button,
.parent-dashboard-live .parent-decision-strip,
.parent-dashboard-live .top-priority-action .button-row .button.secondary {
  display: none !important;
}

.parent-dashboard-live .parent-confidence-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.parent-dashboard-live .parent-confidence-strip .confidence-item.primary {
  background: linear-gradient(135deg, var(--navy), var(--teal));
}

.parent-dashboard-live .top-priority-action {
  padding: clamp(1.2rem, 4vw, 2rem);
  border-left: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 244, 223, 0.72)),
    #fff;
}

.parent-dashboard-live .top-priority-action h2 {
  max-width: 13ch;
  font-family: var(--font-sans);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 800;
  line-height: 0.98;
}

.parent-dashboard-live .top-priority-action .button.primary-action {
  width: min(100%, 360px);
  min-height: 56px;
  border-radius: 16px;
  font-size: 0.98rem;
}

.parent-dashboard-live .evidence-details,
.parent-dashboard-live .subject-improvement-panel,
.parent-dashboard-live .game-activity-panel,
.parent-dashboard-live .student-login-handoff,
.parent-dashboard-live .more-tools-panel {
  margin-top: 2px;
}

@media (max-width: 860px) {
  .parent-dashboard-live .topbar {
    height: 54px;
    padding: 0 14px;
  }

  .parent-dashboard-live .topbar h1,
  .parent-dashboard-live .notification-link {
    display: none;
  }

  .parent-dashboard-live .main-content {
    padding: 14px 12px 40px;
  }

  .parent-dashboard-live .plan-access-panel {
    display: none;
  }

  .parent-dashboard-live .child-switcher-strip {
    padding: 12px;
  }

  .parent-dashboard-live .parent-summary-hero {
    gap: 14px;
    padding: 20px 16px;
  }

  .parent-dashboard-live .parent-confidence-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 78%);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .parent-dashboard-live .parent-confidence-strip::-webkit-scrollbar {
    display: none;
  }

  .parent-dashboard-live .confidence-item {
    scroll-snap-align: start;
  }
}

@media (min-width: 861px) {
  .parent-dashboard-live .main-content {
    max-width: 1180px;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  .student-dashboard-live #student-root main {
    max-width: 1100px;
  }

  .student-dashboard-live #student-root main > section:first-of-type {
    min-height: min(68svh, 650px);
  }

  .student-dashboard-live #student-root main > section:nth-of-type(2) > div:last-child {
    grid-auto-columns: minmax(270px, 34%);
  }

  .parent-dashboard-live .parent-summary-hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.52fr);
  }

  .parent-dashboard-live .top-priority-action {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.88fr);
    align-items: end;
  }

  .parent-dashboard-live .top-priority-action .eyebrow {
    grid-column: 1 / -1;
  }

  .parent-dashboard-live .top-priority-action h2 {
    grid-row: span 3;
  }
}

/* Emotional polish layer: fast, quiet, reward-forward interactions. */

.student-dashboard-live #student-root main > section:first-of-type {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.student-dashboard-live #student-root main > section:first-of-type::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(105deg, transparent 0 36%, rgba(255, 255, 255, 0.24) 48%, transparent 62%);
  animation: mission-aura 7s ease-in-out infinite;
  pointer-events: none;
}

.student-dashboard-live #student-root main > section:first-of-type a[href*="test/"],
.student-dashboard-live #student-root main > section:first-of-type a[href*="student-session"],
.student-dashboard-live #student-root main > section:first-of-type a[href*="student-test"] {
  box-shadow: var(--dashboard-glow);
  transition: transform 180ms var(--dashboard-spring), box-shadow 220ms var(--dashboard-ease), filter 220ms var(--dashboard-ease);
}

.student-dashboard-live #student-root main > section:first-of-type a[href*="test/"]:active,
.student-dashboard-live #student-root main > section:first-of-type a[href*="student-session"]:active,
.student-dashboard-live #student-root main > section:first-of-type a[href*="student-test"]:active {
  transform: translateY(2px) scale(0.985);
  filter: saturate(1.08);
}

.student-dashboard-live #student-root main > section:nth-of-type(2) > div:last-child > a {
  transition: transform 180ms var(--dashboard-ease), box-shadow 180ms var(--dashboard-ease);
}

.parent-dashboard-live .parent-reassurance-note strong {
  display: block;
  font-size: 0.84rem;
  line-height: 1.05;
}

.parent-dashboard-live .parent-reassurance-note span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0.78;
}

.student-dashboard-live.emotion-ready #student-root main > section:first-of-type {
  animation: mission-settle 440ms var(--dashboard-spring) both;
}

.student-dashboard-live .emotion-primary-cta {
  animation: cta-breathe 2.7s ease-in-out infinite;
}

.student-dashboard-live.mission-launching #student-root main > section:first-of-type {
  animation: mission-launch 300ms var(--dashboard-spring) both;
}

.student-dashboard-live.emotion-ready #student-root main > section:first-of-type > div:last-child {
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 14px 28px rgba(23, 35, 66, 0.12);
}

.student-dashboard-live.emotion-ready #student-root main > section:first-of-type > div:last-child::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 42%, rgba(255, 255, 255, 0.2) 50%, transparent 58%);
  transform: translateX(-80%);
  animation: momentum-sheen 3.6s var(--dashboard-ease) infinite;
  pointer-events: none;
}

.emotion-pressable {
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.emotion-pressable:focus-visible {
  outline: 3px solid rgba(255, 209, 102, 0.86);
  outline-offset: 3px;
}

.tap-spark {
  position: fixed;
  z-index: 9998;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  animation: tap-spark 420ms var(--dashboard-ease) forwards;
}

.emotion-toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  width: min(calc(100vw - 32px), 390px);
  padding: 0.8rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(23, 35, 66, 0.92);
  color: #fff;
  box-shadow: 0 18px 42px rgba(23, 35, 66, 0.26);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  transform: translate(-50%, 18px) scale(0.96);
  opacity: 0;
  animation: emotion-toast-in 220ms var(--dashboard-spring) forwards;
  pointer-events: none;
}

.emotion-toast[data-tone="calm"] {
  background: rgba(19, 91, 82, 0.94);
}

.quest-return-celebration {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 35, 66, 0.34);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: celebration-fade-in 180ms var(--dashboard-ease) both;
}

.quest-return-card {
  position: relative;
  width: min(100%, 440px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 209, 102, 0.32), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(238, 248, 246, 0.94));
  box-shadow: 0 28px 70px rgba(23, 35, 66, 0.26);
  padding: 1.15rem;
  color: #172342;
  text-align: left;
  transform: translateY(10px) scale(0.98);
  animation: celebration-card-in 260ms var(--dashboard-spring) both;
}

.quest-return-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 38%, rgba(255, 255, 255, 0.62) 50%, transparent 62%);
  transform: translateX(-75%);
  animation: momentum-sheen 1.7s var(--dashboard-ease) 120ms both;
  pointer-events: none;
}

.quest-return-badge {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, #6d5dfc, #43d39e);
  color: #fff;
  box-shadow: 0 14px 0 rgba(23, 35, 66, 0.12), 0 18px 34px rgba(109, 93, 252, 0.24);
  font-size: 1.7rem;
  font-weight: 900;
}

.quest-return-card h2 {
  margin: 0.9rem 0 0.35rem;
  font-size: clamp(2.1rem, 10vw, 3.2rem);
  line-height: 0.94;
  font-weight: 900;
  letter-spacing: 0;
}

.quest-return-card p {
  margin: 0;
  color: #5d6a86;
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.45;
}

.quest-return-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1rem 0;
}

.quest-return-stats span {
  min-height: 68px;
  padding: 0.7rem;
  border: 1px solid rgba(23, 35, 66, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  color: #5d6a86;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
}

.quest-return-stats strong {
  display: block;
  color: #172342;
  font-size: 1rem;
}

.quest-return-actions {
  display: grid;
  gap: 0.6rem;
}

.quest-return-actions button,
.quest-return-actions a {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.quest-return-actions button {
  background: #172342;
  color: #fff;
}

.quest-return-actions a {
  display: grid;
  place-items: center;
  color: #172342;
  background: rgba(23, 35, 66, 0.07);
}

.parent-dashboard-live .top-priority-action {
  position: relative;
  overflow: hidden;
}

.parent-dashboard-live .top-priority-action::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #2d7a6b, #f5a623, #6d5dfc);
  opacity: 0.72;
}

.parent-dashboard-live .parent-reassurance-note {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  margin: 0.9rem 0 1rem;
  padding: 0.78rem 0.85rem;
  border: 1px solid rgba(45, 122, 107, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--navy, #172342);
}

.parent-dashboard-live .parent-reassurance-note::before {
  content: "";
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 28%, transparent 30%),
    conic-gradient(from -20deg, #2d7a6b 0 78%, rgba(45, 122, 107, 0.14) 78% 100%);
  box-shadow: 0 8px 18px rgba(45, 122, 107, 0.16);
}

.parent-dashboard-live .parent-reassurance-note span {
  color: var(--muted, #64748b);
}

.parent-dashboard-live .top-priority-action .button.primary-action,
.parent-dashboard-live .confidence-item {
  transition: transform 180ms var(--dashboard-ease), box-shadow 180ms var(--dashboard-ease);
}

.parent-dashboard-live .top-priority-action .button.primary-action:active,
.parent-dashboard-live .confidence-item:active {
  transform: translateY(2px) scale(0.99);
}

@media (max-width: 860px) {
  .student-dashboard-live.emotion-ready #student-root main > section:first-of-type > div:last-child {
    font-size: 0.72rem;
  }
}

@keyframes mission-aura {
  0%, 100% {
    transform: translateX(-38%);
    opacity: 0.46;
  }
  50% {
    transform: translateX(38%);
    opacity: 0.72;
  }
}

@keyframes mission-settle {
  from {
    transform: translateY(10px) scale(0.99);
    opacity: 0.9;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes mission-launch {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.012);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes cta-breathe {
  0%, 100% {
    box-shadow: var(--dashboard-glow);
  }
  50% {
    box-shadow: 0 22px 54px rgba(109, 93, 252, 0.3);
  }
}

@keyframes tap-spark {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(18);
  }
}

@keyframes momentum-sheen {
  0%, 44% {
    transform: translateX(-80%);
    opacity: 0;
  }
  58% {
    opacity: 0.72;
  }
  100% {
    transform: translateX(80%);
    opacity: 0;
  }
}

@keyframes emotion-toast-in {
  to {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
}

@keyframes celebration-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes celebration-card-in {
  to {
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .student-dashboard-live #student-root main > section:first-of-type::before,
  .student-dashboard-live.emotion-ready #student-root main > section:first-of-type,
  .student-dashboard-live .emotion-primary-cta,
  .student-dashboard-live.mission-launching #student-root main > section:first-of-type,
  .tap-spark,
  .emotion-toast,
  .quest-return-celebration,
  .quest-return-card,
  .quest-return-card::before {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
