/* base.css — Core styles: body, fonts, animations, toast, hub cards */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

    body {
      font-family: 'Inter', sans-serif;
      margin: 0;
      padding: 0;
      background-color: #0f172a;
      /* slate-900 */
      color: #f1f5f9;
      /* slate-100 */
      overflow-x: hidden;
    }

    @keyframes successBounce {

      0%,
      20%,
      50%,
      80%,
      100% {
        transform: translateY(0) scale(1.03);
      }

      40% {
        transform: translateY(-15px) scale(1.03);
      }

      60% {
        transform: translateY(-7px) scale(1.03);
      }
    }

    @keyframes spin {
      0% {
        transform: rotate(0deg);
      }

      100% {
        transform: rotate(360deg);
      }
    }


    .wrong-cross::before,
    .wrong-cross::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 60%;
      height: 12px;
      background-color: rgba(239, 68, 68, 0.7);
      border-radius: 6px;
      transform-origin: center;
      z-index: 20;
    }

    .wrong-cross::before {
      transform: translate(-50%, -50%) rotate(45deg);
    }

    .wrong-cross::after {
      transform: translate(-50%, -50%) rotate(-45deg);
    }

    .wrong-ban::before {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 80px;
      height: 80px;
      border: 12px solid rgba(239, 68, 68, 0.7);
      border-radius: 50%;
      transform: translate(-50%, -50%);
      z-index: 20;
    }

    .wrong-ban::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 80px;
      height: 12px;
      background-color: rgba(239, 68, 68, 0.7);
      border-radius: 6px;
      transform: translate(-50%, -50%) rotate(-45deg);
      z-index: 20;
    }

    .wrong-question::before {
      content: '?';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 100px;
      font-weight: 800;
      color: rgba(239, 68, 68, 0.7);
      z-index: 20;
      line-height: 1;
    }

    .wrong-dash::before {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 60%;
      height: 12px;
      background-color: rgba(239, 68, 68, 0.7);
      border-radius: 6px;
      transform: translate(-50%, -50%);
      z-index: 20;
    }

    #toast-container {
      position: fixed;
      bottom: 2rem;
      right: 2rem;
      z-index: 1000;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    .toast {
      background: rgba(15, 23, 42, 0.9);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(51, 65, 85, 0.5);
      color: #f1f5f9;
      padding: 1rem 1.5rem;
      border-radius: 1rem;
      box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
      display: flex;
      align-items: center;
      gap: 0.75rem;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      transform: translateX(100%);
      opacity: 0;
    }

    .toast.show {
      transform: translateX(0);
      opacity: 1;
    }

    /* Hub Card Styling */
    .hub-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 2rem;
      width: 100%;
      max-width: 1000px;
      margin: 0 auto;
    }

    .hub-card {
      background: rgba(30, 41, 59, 0.4);
      backdrop-filter: blur(12px);
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 2rem;
      padding: 3rem 2rem;
      text-align: center;
      transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
      cursor: pointer;
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1.5rem;
    }

    .hub-card::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, var(--tw-gradient-from), var(--tw-gradient-to));
      opacity: 0;
      transition: opacity 0.5s ease;
      z-index: -1;
    }

    .hub-card:hover {
      transform: translateY(-10px) scale(1.02);
      border-color: rgba(255, 255, 255, 0.2);
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }

    .hub-card:hover::before {
      opacity: 0.1;
    }

    .hub-card .icon-box {
      width: 80px;
      height: 80px;
      border-radius: 1.5rem;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 0.5rem;
      transition: all 0.5s ease;
      background: rgba(15, 23, 42, 0.5);
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .hub-card:hover .icon-box {
      transform: rotate(12deg) scale(1.1);
      background: var(--tw-gradient-from);
      color: white;
      box-shadow: 0 0 20px var(--tw-gradient-from);
    }

    .hub-card h3 {
      font-size: 1.5rem;
      font-weight: 800;
      color: #f1f5f9;
      letter-spacing: -0.025em;
    }

    .hub-card p {
      font-size: 0.875rem;
      color: #94a3b8;
      line-height: 1.5;
    }


/* Math Game Styles */
    #math-game-viewport {
      position: relative;
      width: 100%;
      height: 600px;
      background: #1e1b4b;
      /* deep indigo */
      border-radius: 2rem;
      overflow: hidden;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
      border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .math-bubble {
      position: absolute;
      width: 120px;
      height: 120px;
      background: white;
      border: 8px solid #3b82f6;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.5rem;
      font-weight: 900;
      color: #1e293b;
      cursor: pointer;
      user-select: none;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
      transition: transform 0.2s, box-shadow 0.2s;
    }

    .math-bubble:hover {
      transform: scale(1.1);
      box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
    }


/* Win Overlay (Peppa) */
    /* Win Overlay */
    #peppa-win-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.95);
      backdrop-filter: blur(16px);
      z-index: 20000;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #peppa-win-overlay.show {
      opacity: 1;
      pointer-events: auto;
    }

    /* Cinematic Victory Animations */
    .peppa-bus.victory-hero {
      left: 50% !important;
      top: 55.7% !important;
      /* Centered in Middle Lane */
      transform: translate(-50%, -50%) rotateX(-45deg) translateZ(150px) scale(2) !important;
      transition: all 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
      z-index: 50000 !important;
    }

    .peppa-celebration-friend {
      position: absolute;
      width: 10vw;
      height: 10vw;
      z-index: 60000;
      pointer-events: none;
      background-size: contain;
      background-repeat: no-repeat;
      background-position: bottom center;
      filter: url(#sticker-border);
      transform: translateY(40px) scale(0);
      opacity: 0;
      transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    }

    .peppa-celebration-friend.visible {
      transform: translateY(0) scale(1);
      opacity: 1;
    }

    .win-card {
      background: linear-gradient(135deg, #1e293b, #0f172a);
      border: 2px solid rgba(16, 185, 129, 0.3);
      border-radius: 3rem;
      padding: 4rem;
      text-align: center;
      max-width: 500px;
      width: 90%;
      box-shadow: 0 0 100px rgba(16, 185, 129, 0.15);
      transform: scale(0.8) translateY(20px);
      transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    #peppa-win-overlay.show .win-card {
      transform: scale(1) translateY(0);
    }

    .victory-badge {
      width: 120px;
      height: 120px;
      background: #10b981;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 2rem;
      box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
      animation: badgePulse 2s infinite;
    }

    @keyframes badgePulse {

      0%,
      100% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
      }

      50% {
        transform: scale(1.1);
        box-shadow: 0 0 80px rgba(16, 185, 129, 0.7);
      }
    }

/* Win Card */
    .win-card {
      background: linear-gradient(135deg, #1e293b, #0f172a);
      border: 2px solid rgba(16, 185, 129, 0.3);
      border-radius: 3rem;
      padding: 4rem;
      text-align: center;
      max-width: 500px;
      width: 90%;
      box-shadow: 0 0 100px rgba(16, 185, 129, 0.15);
      transform: scale(0.8) translateY(20px);
      transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    #peppa-win-overlay.show .win-card {
      transform: scale(1) translateY(0);
    }

    .victory-badge {
      width: 120px;
      height: 120px;
      background: #10b981;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 2rem;
      box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
      animation: badgePulse 2s infinite;
    }

    @keyframes badgePulse {

      0%,
      100% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
      }

      50% {
        transform: scale(1.1);
        box-shadow: 0 0 80px rgba(16, 185, 129, 0.7);
      }
    }
