/* ════════════════════════════════
   PORTFOLIO BUTTON (home screen)
════════════════════════════════ */
.portfolio-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(124,91,248,.12), rgba(73,54,232,.08));
  border: 1.5px solid rgba(124,91,248,.3);
  border-radius: 20px;
  cursor: pointer;
  margin: 14px 0 4px;
  color: var(--text);
  text-align: right;
  transition: transform .15s, box-shadow .15s;
}
.portfolio-btn:active { transform: scale(.98); }
.portfolio-btn-icon { font-size: 28px; flex-shrink: 0; }
.portfolio-btn-body { flex: 1; }
.portfolio-btn-title { font-size: 15px; font-weight: 800; }
.portfolio-btn-sub { font-size: 12px; opacity: .6; margin-top: 2px; }

/* ════════════════════════════════
   PORTFOLIO SECTION
════════════════════════════════ */
.port-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 14px;
}
.port-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 44px;
  font-family: inherit;
  transition: background 0.2s, transform 0.15s;
}
.port-back-btn:active { transform: scale(0.95); }
.port-topbar-title {
  font-size: 17px;
  font-weight: 800;
  flex: 1;
  text-align: right;
}

.port-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 18px;
  gap: 8px;
}
.port-hero-fox {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 24px rgba(124,91,248,.35);
}
.port-hero-name {
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, #7c5bf8, #4936e8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.port-hero-stats {
  display: flex;
  gap: 14px;
  font-size: 13px;
  font-weight: 700;
  opacity: .75;
  flex-wrap: wrap;
  justify-content: center;
}

.port-section-title {
  font-size: 15px;
  font-weight: 800;
  padding: 16px 0 8px;
  opacity: .9;
}

.port-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.port-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.port-card-emoji { font-size: 32px; }
.port-card-title { font-size: 12px; font-weight: 700; }
.port-card-stars { font-size: 14px; letter-spacing: 1px; }
.port-card-date { font-size: 10px; opacity: .45; }
.port-cert {
  border-color: rgba(212,175,55,.45);
  background: rgba(212,175,55,.07);
}

.port-badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.port-badge {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  transition: transform .15s;
}
.port-badge.earned { border-color: rgba(124,91,248,.35); }
.port-badge.locked { opacity: .3; filter: grayscale(1); }
.port-badge-icon { font-size: 22px; }
.port-badge-name { font-size: 9px; font-weight: 700; line-height: 1.2; }

.port-words-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.port-word-chip {
  background: linear-gradient(135deg, #7c5bf8, #4936e8);
  color: white;
  padding: 6px 10px 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(124,91,248,.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.port-word-chip:active {
  transform: scale(0.92);
  box-shadow: 0 1px 4px rgba(124,91,248,.2);
}
.port-chip-icon {
  width: 12px;
  height: 12px;
  opacity: 0.75;
  flex-shrink: 0;
}

.port-empty {
  font-size: 13px;
  opacity: .5;
  padding: 12px 0;
  text-align: center;
  grid-column: 1 / -1;
  font-style: italic;
}

.port-share-btn {
  display: block;
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
  border: none;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin: 10px 0 28px;
  box-shadow: 0 4px 16px rgba(22,163,74,.3);
  font-family: inherit;
  transition: transform .15s;
}
.port-share-btn:active { transform: scale(.97); }

/* ═══════════════════════════════
   CERTIFICATE PRINT BUTTON
═══════════════════════════════ */
.cert-print-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  margin-top: 6px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(245,158,11,.35);
  transition: transform 0.15s;
}
.cert-print-btn:active { transform: scale(0.94); }

/* ═══════════════════════════════
   PRINTABLE CERTIFICATE
   Hidden on screen; visible only during window.print()
═══════════════════════════════ */
#certPrintPage { display: none; }

@media print {
  body { visibility: hidden; }
  #certPrintPage,
  #certPrintPage * { visibility: visible; }
  #certPrintPage {
    display: block;
    position: fixed;
    inset: 0;
    background: white;
    z-index: 99999;
  }

  .cert-inner {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
    direction: rtl;
    background: white;
  }

  .cert-border-outer {
    border: 8px solid #d4af37;
    padding: 5px;
    width: 88vw;
    max-width: 680px;
  }

  .cert-border-inner {
    border: 2px solid #d4af37;
    padding: 28px 40px 22px;
    text-align: center;
    background: linear-gradient(160deg, #fffef6 0%, #fff9e0 100%);
  }

  .cert-top-stars {
    font-size: 24px;
    letter-spacing: 10px;
    color: #d4af37;
    margin-bottom: 10px;
  }

  .cert-logo-wrap { margin: 6px 0 10px; }
  .cert-logo-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 14px rgba(124,91,248,.3);
  }

  .cert-app-name {
    font-size: 28px;
    font-weight: 900;
    color: #7c5bf8;
    letter-spacing: 2px;
    margin: 4px 0 2px;
  }

  .cert-cert-title {
    font-size: 16px;
    font-weight: 700;
    color: #4936e8;
    margin-bottom: 12px;
  }

  .cert-divider {
    width: 80%;
    height: 2px;
    background: linear-gradient(to right, transparent, #d4af37, transparent);
    margin: 0 auto 14px;
  }

  .cert-presents {
    font-size: 13px;
    color: #888;
    margin-bottom: 6px;
  }

  .cert-student-name {
    font-size: 38px;
    font-weight: 900;
    color: #1a1a2e;
    font-style: italic;
    margin-bottom: 10px;
  }

  .cert-body-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
  }

  .cert-unit-emoji { font-size: 52px; margin: 4px 0; }

  .cert-unit-title-he {
    font-size: 26px;
    font-weight: 900;
    color: #7c5bf8;
    margin: 4px 0 2px;
  }

  .cert-unit-title-en {
    font-size: 14px;
    color: #999;
    direction: ltr;
    margin-bottom: 10px;
  }

  .cert-bottom-stars {
    font-size: 18px;
    letter-spacing: 6px;
    color: #d4af37;
    margin-bottom: 14px;
  }

  .cert-date-line {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 14px;
  }

  .cert-sig-area {
    width: 200px;
    margin: 0 auto 10px;
  }

  .cert-sig-line {
    height: 1px;
    background: #bbb;
    margin-bottom: 5px;
  }

  .cert-sig-label {
    font-size: 11px;
    color: #999;
  }

  .cert-site {
    font-size: 10px;
    color: #ccc;
    direction: ltr;
    margin-top: 6px;
  }
}
