/* Originals View — Themed Custom HTML5 Games */

.originals-hero {
    text-align: center;
    padding: 40px 20px 32px;
    position: relative;
}
.originals-hero-icon {
    font-size: 64px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 16px rgba(244,63,94,0.5));
    animation: candyBounce 2s ease-in-out infinite;
}
@keyframes candyBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(-5deg); }
    75% { transform: translateY(-4px) rotate(3deg); }
}
.originals-hero-title {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #FF4D6A, #EC4899, #A855F7, #3B82F6);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: candyGradient 4s ease-in-out infinite;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}
@keyframes candyGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.originals-hero-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0;
}

.originals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
    padding: 0 20px 40px;
    max-width: 960px;
    margin: 0 auto;
}

/* ── Candy Game Card ── */
.candy-card {
    background: rgba(30, 20, 40, 0.9);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    border-top: none;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s;
    position: relative;
}
.candy-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FF4D6A, #EC4899, #A855F7, #3B82F6, #10B981, #F59E0B, #FF4D6A);
    background-size: 200% 100%;
    animation: candyRainbow 3s linear infinite;
}
@keyframes candyRainbow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}
.candy-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow:
        0 16px 48px rgba(244,63,94,0.2),
        0 4px 16px rgba(168,85,247,0.15);
}

/* ── Candy Banner ── */
.candy-card-banner {
    position: relative;
    height: 100px;
    overflow: hidden;
}
.candy-banner-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(255,77,106,0.3),
        rgba(168,85,247,0.3),
        rgba(59,130,246,0.2)
    );
    background-size: 200% 200%;
    animation: candyGradient 6s ease-in-out infinite;
}
.candy-banner-bg::after {
    content: '';  /* themed emoji set by JS */
    display: none;
}
.candy-banner-emoji {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 56px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    animation: candyFloat 3s ease-in-out infinite;
}
@keyframes candyFloat {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    33% { transform: translate(-50%, -55%) rotate(-8deg); }
    66% { transform: translate(-50%, -48%) rotate(5deg); }
}

.original-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px 12px;
}
.original-card-info {
    flex: 1;
    min-width: 0;
}
.original-card-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px;
    color: #FFF;
    letter-spacing: -0.3px;
}
.original-card-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 10px;
    line-height: 1.5;
}

/* ── Candy Tags ── */
.candy-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.candy-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.08);
}

/* ── Candy Scores ── */
.candy-scores {
    padding: 14px 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.02);
}
.original-scores-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.original-score-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 14px;
}
.original-score-rank {
    width: 24px;
    text-align: center;
}
.original-score-player {
    flex: 1;
    color: #E2E8F0;
}
.original-score-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #FFD700;
}

/* ── Inline Score Icons (themed emoji) ── */
.mp-score-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ── Actions ── */
.original-card-actions {
    padding: 16px 24px 22px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.candy-play-btn {
    flex: 1;
    font-size: 17px;
    font-weight: 800;
    padding: 16px 28px;
    border-radius: 14px;
    color: #FFF;
    border: none;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    box-shadow:
        0 4px 16px rgba(244,63,94,0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
    letter-spacing: 0.3px;
}
.candy-play-btn:hover {
    filter: brightness(1.15);
    transform: scale(1.04);
    box-shadow:
        0 8px 24px rgba(244,63,94,0.4),
        inset 0 1px 0 rgba(255,255,255,0.25);
}
.candy-play-btn:active {
    transform: scale(0.97);
}

/* ── Leaderboard Modal ── */
.original-leaderboard-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}
.original-leaderboard-content {
    background: rgba(30, 20, 40, 0.95);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.original-leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.original-leaderboard-header h2 {
    font-size: 18px;
    margin: 0;
}
.original-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}
.original-leaderboard-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.original-leaderboard-table td {
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.original-leaderboard-table .score-val {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #FFD700;
}

/* ══════════════════════════════════════════════════════
   GAME OVER — Themed Reward Celebration
   ══════════════════════════════════════════════════════ */

/* ── Base overlay ── */
.mollypops-gameover {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(50, 10, 60, 0.97), rgba(10, 0, 20, 0.98));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    overflow: hidden;
    animation: mpFadeIn 0.5s ease;
}

/* ── Emoji Rain (themed falling particles) ── */
.mp-rain-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.mp-rain-emoji {
    position: absolute;
    top: -60px;
    opacity: 0.4;
    animation: mpEmojiRain linear infinite;
    filter: blur(0.5px);
    user-select: none;
}
@keyframes mpEmojiRain {
    0% { transform: translateY(-60px) rotate(0deg); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.2; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ── Floating Emoji Stars (top decorations) ── */
.mp-stars-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.mp-float-star-emoji {
    position: absolute;
    opacity: 0;
    animation: mpStarFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255,215,0,0.4));
    user-select: none;
}
@keyframes mpStarFloat {
    0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
    30% { opacity: 0.6; }
    50% { opacity: 0.8; transform: scale(1.1) rotate(15deg); }
    70% { opacity: 0.6; }
}

/* ── Main Content ── */
.mp-gameover-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: mpContentBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}
@keyframes mpContentBounce {
    0% { opacity: 0; transform: scale(0.3) translateY(40px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Hero Theme Emoji Badge ── */
.mp-tier-badge {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.mp-hero-emoji {
    font-size: 80px;
    filter: drop-shadow(0 4px 20px rgba(255,255,255,0.3));
    animation: mpHeroEmoji 2s ease-in-out infinite;
    z-index: 2;
    line-height: 1;
    user-select: none;
}
@keyframes mpHeroEmoji {
    0%, 100% { transform: rotate(-8deg) scale(1); }
    25% { transform: rotate(5deg) scale(1.08); }
    50% { transform: rotate(-3deg) scale(1.05); }
    75% { transform: rotate(8deg) scale(1.1); }
}
.mp-tier-rainbow .mp-hero-emoji {
    animation: mpHeroEmojiRainbow 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255,215,0,0.7)) drop-shadow(0 0 60px rgba(168,85,247,0.4));
}
@keyframes mpHeroEmojiRainbow {
    0%, 100% { transform: rotate(-12deg) scale(1); filter: drop-shadow(0 0 30px rgba(255,215,0,0.7)) hue-rotate(0deg); }
    25% { transform: rotate(10deg) scale(1.15); filter: drop-shadow(0 0 40px rgba(255,77,106,0.8)) hue-rotate(60deg); }
    50% { transform: rotate(-5deg) scale(1.1); filter: drop-shadow(0 0 35px rgba(168,85,247,0.7)) hue-rotate(120deg); }
    75% { transform: rotate(12deg) scale(1.18); filter: drop-shadow(0 0 45px rgba(59,130,246,0.8)) hue-rotate(180deg); }
}
.mp-tier-gold .mp-hero-emoji {
    filter: drop-shadow(0 0 25px rgba(255,215,0,0.6)) drop-shadow(0 4px 20px rgba(255,165,0,0.4));
}

/* ── Explosion Ring (candy particles around badge) ── */
.mp-explosion-ring {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.mp-explosion-piece {
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    opacity: 0;
    animation: mpExplode 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--delay, 0s);
}
@keyframes mpExplode {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateX(0); opacity: 0; }
    30% { opacity: 1; }
    100% {
        transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) translateX(var(--dist, 70px)) rotate(180deg);
        opacity: 0;
    }
}

/* ── Title ── */
.mp-title {
    font-family: var(--font-display, 'Fredoka One', sans-serif);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #F472B6;
    text-shadow: 0 0 20px rgba(244,114,182,0.5);
    animation: mpTitleGlow 2s ease-in-out infinite alternate;
}
@keyframes mpTitleGlow {
    0% { text-shadow: 0 0 10px rgba(244,114,182,0.3), 0 0 20px rgba(244,114,182,0.1); }
    100% { text-shadow: 0 0 20px rgba(244,114,182,0.6), 0 0 40px rgba(244,114,182,0.3), 0 0 60px rgba(168,85,247,0.2); }
}

/* ── MollyPops Counter ── */
.mp-pops-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.mp-pops-number {
    font-family: var(--font-display, 'Fredoka One', sans-serif);
    font-size: 72px;
    font-weight: 900;
    background: linear-gradient(135deg, #FF4D6A, #EC4899, #A855F7, #FFD700);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: mpCountGradient 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 16px rgba(244,63,94,0.4));
    line-height: 1;
}
@keyframes mpCountGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.mp-pops-label {
    font-size: 48px;
    animation: mpLolliWiggle 1s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(255,77,106,0.4));
}
@keyframes mpLolliWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-12deg); }
    75% { transform: rotate(12deg); }
}

/* ── Tier Label ── */
.mp-tier-label {
    font-family: var(--font-pixel, monospace);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    padding: 6px 20px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--tier-glow, #FFD700);
    text-shadow: 0 0 12px var(--tier-glow, #FFD700);
    animation: mpTierPulse 2s ease-in-out infinite;
}
@keyframes mpTierPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255,255,255,0.05); }
    50% { box-shadow: 0 0 16px rgba(255,255,255,0.1), 0 0 30px var(--tier-glow, transparent); }
}
.mp-tier-rainbow .mp-tier-label {
    background: linear-gradient(135deg, rgba(255,77,106,0.15), rgba(168,85,247,0.15), rgba(59,130,246,0.15));
    border-color: rgba(255,215,0,0.3);
    animation: mpTierPulse 1.5s ease-in-out infinite, mpTierRainbow 3s linear infinite;
}
@keyframes mpTierRainbow {
    0% { border-color: #FF4D6A; color: #FF4D6A; }
    25% { border-color: #A855F7; color: #A855F7; }
    50% { border-color: #3B82F6; color: #3B82F6; }
    75% { border-color: #FFD700; color: #FFD700; }
    100% { border-color: #FF4D6A; color: #FF4D6A; }
}

/* ── Score (smaller, below the MollyPops) ── */
.mp-score-display {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    font-variant-numeric: tabular-nums;
}

/* ── Stats Row ── */
.mp-stats-row {
    display: flex;
    gap: 20px;
    margin-top: 4px;
}
.mp-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.04);
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}
.mp-stat-emoji {
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
    user-select: none;
}
.mp-stat-val {
    font-size: 14px;
    font-weight: 700;
    color: #E2E8F0;
    font-variant-numeric: tabular-nums;
}

/* ── Action Buttons ── */
.mp-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}
.mp-actions button {
    padding: 14px 32px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    color: #FFF;
    transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1), filter 0.15s, box-shadow 0.15s;
}
.mp-actions button:hover {
    transform: scale(1.06);
    filter: brightness(1.15);
}
.mp-actions button:active {
    transform: scale(0.97);
}
.mp-play-again {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #FF4D6A, #EC4899, #A855F7);
    background-size: 200% 200%;
    animation: mpBtnGradient 3s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(244,63,94,0.35), 0 0 40px rgba(168,85,247,0.15);
}
@keyframes mpBtnGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
/* button emoji handled inline — no separate class needed */
.mp-exit {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12) !important;
}
.mp-exit:hover {
    background: rgba(255,255,255,0.12);
}

/* ── Entrance Animation ── */
@keyframes mpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ══ Responsive — Reward Screen ══ */
@media (max-width: 600px) {
    .mp-pops-number { font-size: 48px; }
    .mp-pops-label { font-size: 36px; }
    .mp-hero-emoji { font-size: 56px; }
    .mp-tier-badge { width: 90px; height: 90px; }
    .mp-stats-row { flex-wrap: wrap; gap: 8px; justify-content: center; }
    .mp-stat { padding: 6px 10px; }
    .mp-actions { flex-direction: column; width: 100%; padding: 0 20px; }
    .mp-actions button { width: 100%; justify-content: center; }
    .mp-score-display { font-size: 15px; }
    .mp-rain-emoji { opacity: 0.2 !important; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .originals-hero { padding: 24px 16px 20px; }
    .originals-hero-title { font-size: 28px; }
    .originals-hero-icon { font-size: 48px; }
    .originals-grid { grid-template-columns: 1fr; padding: 0 12px 24px; }
    .candy-card-banner { height: 80px; }
    .candy-banner-emoji { font-size: 42px; }
    .original-card-header { padding: 16px 16px 10px; }
    .original-card-title { font-size: 20px; }
    .original-card-actions { padding: 12px 16px 16px; flex-direction: column; }
    .candy-play-btn { width: 100%; }
    .original-gameover .go-score { font-size: 38px; }
    .original-gameover .go-stats { flex-direction: column; gap: 8px; text-align: center; }
    .candy-tags { justify-content: center; }
}
