
:root {
  --blue-deep: #3A8DFF;
  --blue-mid: #3A8DFF;
  --blue-light: #e8f1ff;
  --blue-very-light: #f4f8ff;
  --card-bg: #ffffff;
  --accent-orange: #FF9F45;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius-lg: 22px;
  --shadow-main: 0 18px 45px rgba(15, 23, 42, 0.23);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.15);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #F4F4F4;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
}

    .dashboard-wrapper {
      width: 100%;
      max-width: 1220px;
    }

.dashboard-card {
  border-radius: var(--radius-lg);
  border: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, var(--blue-very-light));
  box-shadow: var(--shadow-main);
}

    .dashboard-inner {
      padding: 24px 22px 26px;
      background: radial-gradient(circle at top, rgba(255,255,255,0.7), transparent 65%);
    }

.top-bar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  padding: 10px 22px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

    .top-logo {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .top-logo img {
      width: 46px;
      height: 46px;
      border-radius: 14px;
    }

    .top-logo-text {
      font-weight: 700;
      color: var(--blue-deep);
      letter-spacing: 0.03em;
    }

.top-right {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}

    .grade-pill {
      background: rgba(255, 255, 255, 0.9);
      border-radius: 999px;
      padding: 6px 14px;
      font-size: 0.8rem;
      color: var(--blue-deep);
      border: 1px solid rgba(148, 163, 184, 0.45);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .icon-btn {
      width: 36px;
      height: 36px;
      border-radius: 999px;
      border: none;
      background: rgba(255, 255, 255, 0.95);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
      color: var(--blue-deep);
      position: relative;
    }

    .icon-btn .badge {
      font-size: 0.62rem;
      padding: 2px 4px;
    }

    .avatar-circle {
      width: 40px;
      height: 40px;
      border-radius: 999px;
      background: linear-gradient(135deg, #ffcf9b, #ff8a34);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--blue-deep);
      font-weight: 700;
    }

    .header-title {
      font-size: 1.9rem;
      font-weight: 800;
      color: var(--blue-deep);
      letter-spacing: 0.03em;
    }

.stat-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  padding: 16px 8px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.stat-card:hover { transform: translateY(-4px) scale(1.02); }
.stat-card.animate-assemble { animation: assemble3D 0.9s cubic-bezier(0.2,0.8,0.2,1) both; transform-style: preserve-3d; perspective: 800px; }
@keyframes assemble3D { from { transform: translate3d(var(--sx),var(--sy),var(--sz)) rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz)) scale(0.88); opacity: 0; filter: blur(4px); } to { transform: translate3d(0,0,0) rotateX(0) rotateY(0) rotateZ(0) scale(1); opacity: 1; filter: blur(0); } }

    .stat-icon {
      width: 32px;
      height: 32px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 6px;
      background: rgba(59, 130, 246, 0.08);
      color: var(--blue-deep);
      font-size: 0.85rem;
    }

    .stat-label {
      font-size: 0.8rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 2px;
    }

    .stat-value {
      font-size: 1.35rem;
      font-weight: 800;
      color: var(--text-main);
    }

    .section-title {
      font-size: 1rem;
      font-weight: 700;
      color: var(--text-main);
      margin-bottom: 10px;
    }

.card-soft {
  border-radius: 18px;
  border: 0;
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card-soft:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.23);
}

    .card-link {
      text-decoration: none;
      color: inherit;
      display: block;
    }

    .btn-pill {
      border-radius: 999px;
    }

.btn-orange {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #ffffff;
  font-weight: 600;
}
.btn-orange:hover {
  background: #ff8a34;
  border-color: #ff8a34;
  color: #ffffff;
}
.btn, .icon-btn, .btn-pill { transition: transform 0.2s ease; }
.btn:active, .icon-btn:active { transform: scale(0.96); }
.btn:hover, .icon-btn:hover { transform: translateY(-2px) scale(1.05) rotateX(2deg); box-shadow: 0 12px 28px rgba(15,23,42,0.22); }

.animate-slide-left { animation: slideInLeft 0.8s ease-out both; }
.animate-slide-right { animation: slideInRight 0.8s ease-out both; }
.animate-bounce { transition: transform 0.2s; }
.animate-bounce:hover { transform: translateY(-2px) scale(1.06); }

@keyframes slideInLeft { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.stat-value--pulse { position: relative; }
.stat-value--pulse::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 80%;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-orange), rgba(255,159,69,0.45));
  animation: pulseBar 1.8s ease-in-out infinite;
}
@keyframes pulseBar { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

.welcome-popup { position: fixed; inset: 0; 
  display: grid; place-items: center; z-index: 9999;
   /* opacity: 0;  */
   pointer-events: none; transition: opacity 0.35s ease; }
.welcome-popup.show { 
  /* opacity: 0;  */
  pointer-events: auto; }
.welcome-bg { position: absolute; inset: 0;
  max-width: 100%;
  /* width:1000px; */
  max-height: 100%;
  /* background: rgba(0,0,0,0.45); */
   /* backdrop-filter: blur(4px);  */
  }
.welcome-inner { position: relative; background: #fff; border-radius: 26px; padding: 18px 18px; 
  /* display: inline-block; */
   max-width: min(560px, 94vw);
    width:100%; 
    /* max-width: 1000px;  */
    box-shadow: 0 26px 60px rgba(0,0,0,0.35); 
    animation: popupZoom 0.35s ease-out both; }
.welcome-fullscreen {
  display: flex;
  justify-content: center;align-items: center;
  flex-direction: column;
  padding: 0; background: transparent; 
  border-radius: 0; box-shadow: none;
   /* width: 100vw; 
    height: 100vh;  */
  }
.welcome-image { 
  max-width: 1220px;
   max-width: 100%; 
   height: auto;  
    /* object-fit: contain; */
     border-radius: 18px;
   image-rendering: -webkit-optimize-contrast;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.welcome-image--fullscreen { 
  width: 100%; height: auto;
  max-width: 1000px ;
  max-height: 700px;
   /* object-fit: cover; */
    border-radius: 0; }
.welcome-actions { 
  display: flex; justify-content: center; padding-top: 12px; }
@keyframes popupZoom { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* .welcome-gear { position: absolute; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle,#ffe3c8,#ffd0a1); box-shadow: inset 0 0 6px rgba(0,0,0,0.15), 0 6px 16px rgba(0,0,0,0.25); animation: gearSpin 6s linear infinite; }
.welcome-gear-1 { top: 12%; left: 12%; }
.welcome-gear-2 { top: 18%; right: 10%; animation-duration: 7.5s; }
.welcome-gear-3 { bottom: 14%; left: 8%; animation-duration: 9s; } */
@keyframes gearSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
  /* Games Page Styling */
.game-container {
    background: rgba(116, 157, 235, 0.95);
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.game-title-img {
    max-width: 150px;
    height: auto;
}

.game-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--blue-deep);
}

.back-to-lab {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--blue-deep);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background-color: #ffffff;
    border: 2px solid var(--blue-deep);
    border-radius: 10px;
}

.back-to-lab img {
    width: 20px;
    height: 20px;
}

.game-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
}

/* Game Links */
.game-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.game-link {
    background-color: var(--blue-mid);
    color: #ffffff;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.game-link:hover {
    background-color: var(--blue-deep);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
    transform: translateY(-3px);
}

.game-link:active {
    transform: scale(0.98);
}

.game-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.btn-cta {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.btn-cta a {
    text-decoration: none;
    color: #ffffff;
    background-color: var(--accent-orange);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-cta a:hover {
    background-color: #ff7b17;
}
.hidden { opacity: 0 !important; pointer-events: none !important; display: none !important; }
.dash-suspend { opacity: 0; filter: blur(1.5px); pointer-events: none; transition: opacity 0.35s ease, filter 0.35s ease; }
.dash-active { opacity: 1; filter: none; }

/* -------------------------------
   Responsive Tweaks
------------------------------- */

/* Small phones */
@media (max-width: 576px) {
  body { padding: 16px 8px; }
  .dashboard-inner { padding: 16px 12px 18px; }
  .top-bar { padding: 8px 12px;  gap: 8px; }
  .top-right { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .header-title { font-size: clamp(1.4rem, 4vw, 1.6rem); }
  .stat-card { padding: 12px 6px; }
  .icon-btn { width: 32px; height: 32px; }
  .avatar-circle { width: 36px; height: 36px; }
  .grade-pill { font-size: 0.75rem; padding: 5px 10px; }
  .game-content { flex-direction: column; }
  .game-title-img { max-width: 120px; }
}

/* Tablets */
@media (min-width: 577px) and (max-width: 768px) {
  .dashboard-inner { padding: 20px; }
  .header-title { font-size: clamp(1.6rem, 3.2vw, 1.8rem); }
  .stat-card { padding: 14px 8px; }
  .icon-btn { width: 34px; height: 34px; }
  .top-logo img { width: 42px; height: 42px; }
  .game-content { flex-direction: column; }
}

/* Desktops */
@media (min-width: 769px) and (max-width: 1200px) {
  .dashboard-wrapper { max-width: 1024px; }
  .header-title { font-size: clamp(1.7rem, 2.6vw, 2rem); }
}

/* Large screens */
@media (min-width: 1400px) {
  .dashboard-wrapper { max-width: 1320px; }
  .welcome-image--fullscreen { max-width: 1200px; }
}

@media (max-width: 992px) {
  #gradePill { display: none; }
  #gradePill.show { display: inline-flex; }
}

/* Course dropdown in My Courses */
.course-item .dropdown:hover .dropdown-menu { display: block; }
.course-dropdown { min-width: 320px; box-shadow: 0 14px 32px rgba(15,23,42,0.12); border-radius: 12px; }
.course-brief { display: none; }
.course-item:hover .course-brief { display: block; }
