    /* ── PET SPECIES PICKER ── */
    @keyframes speciesBounce {

      0%,
      100% {
        transform: translateY(0)
      }

      50% {
        transform: translateY(-10px)
      }
    }

    @keyframes speciesFloat {

      0%,
      100% {
        transform: translateY(0) rotate(-4deg)
      }

      50% {
        transform: translateY(-7px) rotate(4deg)
      }
    }

    @keyframes speciesHop {

      0%,
      45%,
      100% {
        transform: translateY(0)
      }

      22% {
        transform: translateY(-14px) scaleX(.9) scaleY(1.1)
      }
    }

    @keyframes speciesSlide {

      0%,
      100% {
        transform: translateX(0)
      }

      50% {
        transform: translateX(7px)
      }
    }

    @keyframes speciesWiggle {

      0%,
      100% {
        transform: rotate(0)
      }

      25% {
        transform: rotate(-9deg)
      }

      75% {
        transform: rotate(9deg)
      }
    }

    .species-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-bottom: 18px;
    }

    .species-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 12px 6px 10px;
      gap: 4px;
      background: var(--surface-2);
      border: 2px solid var(--border);
      border-radius: 14px;
      cursor: pointer;
      transition: border-color .2s, background .2s, transform .15s;
      user-select: none;
    }

    .species-card:hover {
      background: var(--surface-3);
    }

    .species-card.selected {
      border-color: var(--gold);
      background: rgba(255, 200, 61, .12);
      transform: scale(1.04);
    }

    .species-card .sp-emoji {
      font-size: 36px;
      line-height: 1;
      display: block;
    }

    .species-card .sp-name {
      font-family: var(--display);
      font-weight: 800;
      font-size: 11px;
      color: var(--ink);
    }

    .species-card .sp-desc {
      font-size: 9px;
      color: var(--ink-muted);
      text-align: center;
      line-height: 1.3;
    }

    /* ── PROFILE PHOTO PREVIEW ── */
    #profile-photo-preview {
      width: 64px;
      height: 64px;
      border-radius: 50%;
      background: linear-gradient(135deg, #ffe0b2, #ffb74d);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 36px;
      overflow: hidden;
      flex-shrink: 0;
      border: 2px solid var(--border-strong);
    }

    #profile-photo-preview img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 50%;
    }

    .photo-upload-label {
      display: block;
      padding: 10px 16px;
      background: var(--surface-2);
      border: 1.5px solid var(--border-strong);
      border-radius: 10px;
      cursor: pointer;
      font-family: var(--display);
      font-weight: 700;
      font-size: 13px;
      color: var(--ink);
      text-align: center;
    }

    .levelup-card {
      background: linear-gradient(170deg, #1a2540 0%, #12193a 100%);
      border-radius: var(--radius-lg);
      padding: 0;
      text-align: center;
      max-width: 360px;
      width: 100%;
      box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1.5px rgba(255, 200, 61, .25);
      animation: levelPop .45s var(--ease-bounce);
      overflow: hidden;
    }

    .levelup-banner {
      background: linear-gradient(135deg, #FF9800 0%, #E65100 100%);
      padding: 22px 20px 18px;
      position: relative;
      overflow: hidden;
    }

    .levelup-banner::before {
      content: '';
      position: absolute;
      inset: 0;
      background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='160' cy='30' r='80' fill='rgba(255,255,255,.08)'/%3E%3Ccircle cx='20' cy='160' r='60' fill='rgba(255,255,255,.05)'/%3E%3C/svg%3E") center/cover no-repeat;
      pointer-events: none;
    }

    @keyframes levelPop {
      0% {
        transform: scale(.55) translateY(30px);
        opacity: 0;
      }

      70% {
        transform: scale(1.04) translateY(-4px);
        opacity: 1;
      }

      100% {
        transform: scale(1) translateY(0);
        opacity: 1;
      }
    }

    @keyframes starPulse {

      0%,
      100% {
        transform: scale(1);
      }

      50% {
        transform: scale(1.15);
      }
    }

    .levelup-stars {
      font-size: 32px;
      letter-spacing: 6px;
      margin-bottom: 10px;
      display: block;
      animation: starPulse 1.2s ease-in-out infinite;
    }

    .levelup-lvlbadge {
      display: inline-block;
      color: white;
      font-family: var(--display);
      font-weight: 900;
      font-size: 13px;
      padding: 4px 14px;
      border-radius: 20px;
      margin-bottom: 6px;
      background: rgba(255, 255, 255, .2);
      letter-spacing: 1px;
      text-transform: uppercase;
    }

    .levelup-title {
      font-family: var(--display);
      font-size: 30px;
      font-weight: 900;
      color: #fff;
      text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
      letter-spacing: -0.5px;
    }

    .levelup-body {
      padding: 20px 22px 22px;
    }

    .levelup-msg {
      font-size: 14px;
      color: rgba(255, 255, 255, .7);
      font-weight: 600;
      line-height: 1.55;
      margin-bottom: 16px;
    }

    .levelup-perks {
      background: rgba(255, 255, 255, .07);
      border-radius: 14px;
      padding: 13px 15px;
      margin-bottom: 20px;
      text-align: left;
      border: 1.5px solid rgba(255, 255, 255, .12);
    }

    .levelup-perk {
      display: flex;
      align-items: flex-start;
      gap: 9px;
      font-size: 13px;
      font-weight: 600;
      color: rgba(255, 255, 255, .88);
      padding: 5px 0;
      line-height: 1.4;
    }

    .levelup-perk+.levelup-perk {
      border-top: 1px solid rgba(255, 255, 255, .08);
    }

    .levelup-perk-icon {
      flex-shrink: 0;
      font-size: 15px;
    }

    .levelup-continue-btn {
      width: 100%;
      background: linear-gradient(135deg, #FFC83D, #E8A92B);
      color: #243042;
      border: none;
      border-radius: var(--radius-md);
      padding: 15px;
      font-size: 16px;
      font-weight: 900;
      font-family: var(--display);
      cursor: pointer;
      box-shadow: 0 5px 0 #a06a10;
      transition: transform .1s, box-shadow .1s;
      letter-spacing: 0.3px;
    }

    .levelup-continue-btn:active {
      transform: translateY(3px);
      box-shadow: 0 2px 0 #a06a10;
    }

    /* LOCKED TIER OVERLAY on shop items */
    .tier-locked-badge {
      font-size: 9px;
      font-weight: 800;
      padding: 2px 6px;
      border-radius: 6px;
      background: rgba(255, 255, 255, .08);
      color: var(--ink-muted);
      border: 1px solid var(--border);
      font-family: var(--display);
    }

    /* FOCUS RING — keyboard navigation */
    :focus-visible {
      outline: 3px solid var(--gold);
      outline-offset: 2px;
    }

    /* ── MINI-GAME OVERLAY ── */
    #minigame-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 9999;
      background: rgba(0, 0, 0, 0.82);
      backdrop-filter: blur(4px);
      align-items: center;
      justify-content: center;
    }

    #minigame-overlay.show {
      display: flex;
    }

    .mg-card {
      background: #1a2030;
      border-radius: 24px;
      padding: 0;
      width: min(92vw, 420px);
      max-height: 90vh;
      overflow: hidden;
      box-shadow: 0 24px 80px rgba(0, 0, 0, .6), 0 0 0 2px rgba(255, 200, 61, .3);
      display: flex;
      flex-direction: column;
    }

    .mg-header {
      background: linear-gradient(135deg, #243042, #1a2030);
      padding: 16px 20px 12px;
      border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

    .mg-title {
      font-family: 'Baloo 2', sans-serif;
      font-size: 20px;
      font-weight: 800;
      color: #FFC83D;
      margin: 0;
    }

    .mg-subtitle {
      font-family: 'Fredoka', sans-serif;
      font-size: 13px;
      color: rgba(255, 255, 255, .55);
      margin: 2px 0 0;
    }

    .mg-arena {
      flex: 1;
      position: relative;
      min-height: 240px;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }


    .mg-footer {
      padding: 10px 16px 14px;
      display: flex;
      gap: 8px;
      border-top: 1px solid rgba(255, 255, 255, .07);
    }

    .mg-skip-btn {
      flex: 1;
      background: transparent;
      border: 1px solid rgba(255, 255, 255, .18);
      color: rgba(255, 255, 255, .45);
      border-radius: 10px;
      padding: 8px;
      font-family: 'Fredoka', sans-serif;
      font-size: 13px;
      cursor: pointer;
    }

    .mg-result {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 10;
      background: rgba(0, 0, 0, .7);
      border-radius: 0;
    }

    .mg-result-title {
      font-family: 'Baloo 2', sans-serif;
      font-size: 32px;
      font-weight: 800;
      margin: 0;
      padding: 0;
    }

    .mg-result-title.win {
      color: #5BBE6B;
      text-shadow: 0 0 24px #5BBE6B88;
    }

    .mg-result-title.lose {
      color: #FF6B6B;
      text-shadow: 0 0 24px #FF6B6B88;
    }

    .mg-result-sub {
      font-family: 'Fredoka', sans-serif;
      font-size: 14px;
      color: rgba(255, 255, 255, .65);
      margin-top: 6px;
      text-align: center;
      padding: 0 16px;
    }
