/* Victory Modal - Enhanced Material Design */
.victory-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.victory-content {
    position: relative;
    background: white;
    padding: 0;
    border-radius: 24px;
    text-align: center;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2), 0 12px 24px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(60px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Close Button */
.victory-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

.victory-close svg {
    width: 20px;
    height: 20px;
    color: white;
    transition: transform 0.2s ease;
}

.victory-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.victory-close:hover svg {
    transform: rotate(90deg);
}

.victory-close:focus {
    outline: none;
}

/* Victory Header */
.victory-header {
    padding: 32px 24px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: #6366f1;
    color: white;
    position: relative;
    overflow: hidden;
}

.victory-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30%, -30%); }
}

/* Victory Stars Rating */
.victory-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 20px;
    animation: starsAppear 0.6s ease 0.2s both;
}

@keyframes starsAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* When stars are hidden for given-up puzzles */
.victory-stars[style*="display: none"] {
    margin: 0;
    height: 0;
}

.victory-star {
    width: 40px;
    height: 40px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.victory-star svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.victory-star.filled svg {
    animation: starPop 0.4s ease;
}

.victory-star:hover {
    transform: scale(1.1);
}

@keyframes starPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Star Tooltip Styles */
.star-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 280px;
    text-align: center;
    z-index: 10000;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.star-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.star-tooltip.below {
    transform: translateY(-5px);
}

.star-tooltip.below.visible {
    transform: translateY(0);
}

/* Add arrow to tooltip */
.star-tooltip::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    bottom: -12px;
}

.star-tooltip.below::before {
    top: -12px;
    bottom: auto;
    border-top-color: transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
}

.victory-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.victory-subtitle {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    opacity: 0.95;
}

/* Victory Body */
.victory-body {
    padding: 32px 24px;
    background: #fafbfc;
}

.headline-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.headline-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.article-prompt {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 8px;
}

.headline-reveal {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.article-prompt {
    font-size: 0.7rem;
    font-weight: 500;
    color: #9ca3af;
    margin: 0;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
    -webkit-text-stroke: 1px currentColor;
    paint-order: stroke fill;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.05em;
}

/* Victory Actions */
.victory-actions {
    padding: 0 24px 32px;
    background: #fafbfc;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    text-align: center;
    -webkit-text-stroke: 0.5px currentColor;
    paint-order: stroke fill;
}

.btn-primary {
    background: #f59e0b;
    color: white;
}

.btn-primary:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
    background: #3b82f6;
    color: white;
    font-family: 'Comfortaa', sans-serif;
}

.btn-secondary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Confetti Animation */
.victory-confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.victory-confetti span {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffd700;
    top: -10px;
    animation: confetti-fall 3s ease-in-out infinite;
}

.victory-confetti span:nth-child(1) { left: 10%; animation-delay: 0s; background: #ff6b6b; }
.victory-confetti span:nth-child(2) { left: 20%; animation-delay: 0.3s; background: #4ecdc4; }
.victory-confetti span:nth-child(3) { left: 30%; animation-delay: 0.6s; background: #45b7d1; }
.victory-confetti span:nth-child(4) { left: 40%; animation-delay: 0.9s; background: #f9ca24; }
.victory-confetti span:nth-child(5) { left: 50%; animation-delay: 1.2s; background: #f0932b; }
.victory-confetti span:nth-child(6) { left: 60%; animation-delay: 1.5s; background: #eb4d4b; }
.victory-confetti span:nth-child(7) { left: 70%; animation-delay: 1.8s; background: #6ab04c; }
.victory-confetti span:nth-child(8) { left: 80%; animation-delay: 2.1s; background: #c56cf0; }
.victory-confetti span:nth-child(9) { left: 90%; animation-delay: 2.4s; background: #ffd93d; }
.victory-confetti span:nth-child(10) { left: 95%; animation-delay: 2.7s; background: #6bcf7f; }

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}
