/* struct-graduation.css — epic 55-day course graduation */

.struct-graduation-banner {
  display: none;
  position: relative;
  margin-bottom: 28px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--grad-color, #d4a820) 55%, rgba(255, 255, 255, 0.12));
  background:
    radial-gradient(ellipse 90% 80% at 50% -20%, color-mix(in srgb, var(--grad-color, #d4a820) 28%, transparent), transparent 60%),
    linear-gradient(155deg, rgba(28, 20, 8, 0.98), rgba(10, 12, 22, 0.99));
  box-shadow:
    0 0 60px color-mix(in srgb, var(--grad-color, #d4a820) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: structGradIn 0.9s cubic-bezier(0.34, 1.25, 0.64, 1) both;
}

.struct-graduation-banner.show {
  display: block;
}

.struct-graduation-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.06) 48%,
    transparent 58%
  );
  background-size: 220% 100%;
  animation: structGradShine 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes structGradIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes structGradShine {
  0%, 100% { background-position: 120% 0; }
  50% { background-position: -20% 0; }
}

.struct-graduation-hero {
  position: relative;
  padding: 28px 28px 20px;
  text-align: center;
}

.struct-graduation-crown {
  font-size: 1.6rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 12px rgba(255, 215, 120, 0.5));
  animation: structGradPulse 2.4s ease-in-out infinite;
}

@keyframes structGradPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.92; }
}

.struct-graduation-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mint, #00f5d4);
  margin-bottom: 12px;
}

.struct-graduation-kanji-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 108px;
  margin: 0 auto 14px;
}

.struct-graduation-kanji-ring::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--grad-color, #d4a820) 70%, transparent);
  animation: structGradRing 3s linear infinite;
}

@keyframes structGradRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.struct-graduation-kanji {
  font-family: var(--font-jp, serif);
  font-size: 3.2rem;
  line-height: 1;
  color: #ffe9a8;
  text-shadow: 0 0 40px color-mix(in srgb, var(--grad-color, #d4a820) 80%, transparent);
}

.struct-graduation-title {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 900;
  color: #fff;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.struct-graduation-sub {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 18px;
}

.struct-graduation-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 20px 20px;
  max-width: 640px;
  margin: 0 auto;
}

.struct-graduation-stat {
  padding: 14px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.struct-graduation-stat-val {
  display: block;
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 4px;
}

.struct-graduation-stat-lbl {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.struct-graduation-stat--reward .struct-graduation-stat-val {
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.35);
}

.struct-graduation-cert {
  margin: 0 20px 22px;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px dashed color-mix(in srgb, var(--grad-color, #d4a820) 45%, rgba(255, 255, 255, 0.15));
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.struct-graduation-seal {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-jp, serif);
  font-size: 1.75rem;
  color: #5a3010;
  background: radial-gradient(circle at 35% 30%, #ffd27a, #c9862e 55%, #8b5a18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.35);
}

.struct-graduation-cert-copy {
  flex: 1;
  min-width: 200px;
}

.struct-graduation-cert-copy strong {
  display: block;
  color: #ffe6a8;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.struct-graduation-cert-copy span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.struct-graduation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px 24px;
}

.struct-graduation-note {
  width: 100%;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.48);
}

.struct-graduation-replay {
  font-size: 0.82rem;
  color: var(--mint, #00f5d4);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 8px;
}

.struct-graduation-replay:hover {
  color: #fff;
}

.day-complete-banner.struct-day-complete--epic {
  background:
    radial-gradient(ellipse 80% 100% at 50% 0%, rgba(255, 193, 80, 0.12), transparent 55%),
    linear-gradient(135deg, #141a0c, #0a120c);
  border-color: rgba(255, 193, 80, 0.45);
  animation: structGradIn 0.7s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

.day-complete-banner.struct-day-complete--epic h3 {
  color: #ffd27a;
  font-size: 1.25rem;
}

/* Full-screen graduation modal */
.flj-grad-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 6, 14, 0.88);
  backdrop-filter: blur(10px);
  animation: fljGradFadeIn 0.45s ease both;
}

.flj-grad-overlay.flj-grad-closing {
  animation: fljGradFadeOut 0.35s ease forwards;
}

@keyframes fljGradFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fljGradFadeOut {
  to { opacity: 0; }
}

.flj-grad-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(92vh, 820px);
  overflow-y: auto;
  text-align: center;
  padding: 36px 28px 30px;
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--grad-color, #d4a820) 40%, rgba(255, 255, 255, 0.1));
  background: linear-gradient(165deg, rgba(22, 18, 12, 0.97), rgba(8, 10, 20, 0.98));
  box-shadow:
    0 50px 120px rgba(0, 0, 0, 0.65),
    0 0 100px color-mix(in srgb, var(--grad-color, #d4a820) 18%, transparent);
  animation: fljGradCardPop 0.85s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

@keyframes fljGradCardPop {
  from { opacity: 0; transform: translateY(40px) scale(0.9); }
  to { opacity: 1; transform: none; }
}

.flj-grad-rays {
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    color-mix(in srgb, var(--grad-color, #d4a820) 12%, transparent) 20deg,
    transparent 40deg,
    transparent 180deg,
    color-mix(in srgb, var(--grad-color, #d4a820) 10%, transparent) 200deg,
    transparent 220deg
  );
  animation: fljGradRays 12s linear infinite;
  pointer-events: none;
  opacity: 0.7;
}

@keyframes fljGradRays {
  to { transform: rotate(360deg); }
}

.flj-grad-eyebrow {
  position: relative;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mint, #00f5d4);
  margin-bottom: 16px;
}

.flj-grad-kanji {
  position: relative;
  font-family: var(--font-jp, serif);
  font-size: clamp(3.5rem, 12vw, 5rem);
  line-height: 1;
  color: #ffe9a8;
  text-shadow: 0 0 50px color-mix(in srgb, var(--grad-color, #d4a820) 70%, transparent);
  margin-bottom: 8px;
}

.flj-grad-title {
  position: relative;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  color: #fff;
  margin: 0 0 12px;
}

.flj-grad-msg {
  position: relative;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0 0 22px;
}

.flj-grad-rewards {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.flj-grad-reward-pill {
  padding: 10px 16px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.flj-grad-reward-pill--gold {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
  animation: structGradPulse 2s ease-in-out infinite;
}

.flj-grad-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  border: none;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  color: #0a0c12;
  background: linear-gradient(135deg, #ffe9a8, #d4a820);
  box-shadow: 0 8px 32px rgba(212, 168, 32, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.flj-grad-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.flj-grad-btn:active {
  transform: scale(0.97);
}

.flj-grad-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.flj-grad-btn--ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.flj-grad-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  filter: none;
}

.flj-grad-voice-hint {
  position: relative;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 12px;
}

.struct-graduation-cert-actions,
.flj-grad-card .struct-graduation-cert-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0 8px;
}

.struct-graduation-cert-btn {
  padding: 10px 18px;
  border-radius: 100px;
  border: 1px solid rgba(255, 215, 120, 0.45);
  background: rgba(255, 215, 120, 0.1);
  color: #ffe9a8;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.struct-graduation-cert-btn:hover {
  background: rgba(255, 215, 120, 0.2);
  transform: translateY(-1px);
}

.struct-graduation-cert-btn--ghost {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.75);
}

.flj-confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 11999;
}

.flj-confetti-canvas--under {
  position: absolute;
  z-index: 0;
}

.flj-grad-overlay .flj-grad-card {
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .struct-graduation-stats {
    grid-template-columns: 1fr;
  }
  .struct-graduation-cert {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .struct-graduation-banner,
  .struct-graduation-banner::before,
  .struct-graduation-crown,
  .struct-graduation-kanji-ring::before,
  .flj-grad-overlay,
  .flj-grad-card,
  .flj-grad-rays,
  .flj-grad-reward-pill--gold {
    animation: none !important;
  }
}