/* ============================================================
   CCT Easter Egg — Pill Catcher
   Triggered by typing MEDIC anywhere on the page
   ============================================================ */

/* Overlay */
#cct-egg-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 29, 74, 0.92);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
#cct-egg-overlay.is-active {
    display: flex;
    animation: eggFadeIn 0.4s ease;
}
@keyframes eggFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Game container */
#cct-egg-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 0;
    width: min(520px, 94vw);
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: eggSlideUp 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes eggSlideUp {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Header */
#cct-egg-header {
    background: linear-gradient(135deg, #1a1d4a 0%, #2D3070 100%);
    padding: 20px 24px 16px;
    text-align: center;
    position: relative;
}
#cct-egg-header h2 {
    color: #ffffff;
    font-size: 1.3rem;
    margin: 0 0 4px;
    font-family: 'Playfair Display', Georgia, serif;
}
#cct-egg-header p {
    color: rgba(255,255,255,0.6);
    font-size: 0.8125rem;
    margin: 0;
}
#cct-egg-secret-badge {
    background: #E8589A;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 8px;
}

/* Close button */
#cct-egg-close {
    position: absolute;
    top: 14px; right: 16px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}
#cct-egg-close:hover { background: rgba(255,255,255,0.3); }

/* Score/lives bar */
#cct-egg-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #f8f7fc;
    border-bottom: 1px solid #e4e2f0;
    font-size: 0.875rem;
    font-family: 'DM Sans', sans-serif;
}
#cct-egg-score-label { color: #555577; }
#cct-egg-score-val {
    font-weight: 700; color: #2D3070; font-size: 1.1rem;
}
#cct-egg-lives { display: flex; gap: 4px; }
.cct-egg-life { font-size: 1.1rem; transition: opacity 0.3s; }
.cct-egg-life.lost { opacity: 0.15; }
#cct-egg-level-label {
    color: #E8589A; font-weight: 600; font-size: 0.8125rem;
}

/* Canvas */
#cct-egg-canvas {
    display: block;
    width: 100%;
    background: #f0eef8;
    cursor: none;
    touch-action: none;
}

/* Message screens */
#cct-egg-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 28px;
    text-align: center;
    min-height: 280px;
    background: #f8f7fc;
}
#cct-egg-screen.is-visible { display: flex; }
#cct-egg-screen h3 {
    font-size: 1.5rem;
    color: #1a1d4a;
    margin: 0 0 10px;
    font-family: 'Playfair Display', serif;
}
#cct-egg-screen p {
    color: #555577; font-size: 0.9375rem; margin: 0 0 20px; line-height: 1.6;
}
#cct-egg-screen .cct-egg-emoji {
    font-size: 3.5rem; margin-bottom: 12px; display: block;
    animation: eggyBounce 0.6s ease;
}
@keyframes eggyBounce {
    0%,100% { transform: translateY(0); }
    40%      { transform: translateY(-16px); }
}
#cct-egg-final-score {
    font-size: 2.5rem; font-weight: 700;
    color: #E8589A;
    font-family: 'Playfair Display', serif;
    display: block; margin-bottom: 4px;
}
.cct-egg-certificate {
    background: linear-gradient(135deg, #fff8fb, #fceef5);
    border: 2px solid #E8589A;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 12px 0 20px;
    width: 100%;
}
.cct-egg-certificate p {
    margin: 0; font-size: 0.875rem; color: #2D3070;
    font-style: italic;
}
.cct-egg-certificate strong {
    font-size: 1rem; color: #E8589A; display: block; margin-bottom: 4px;
}

/* Buttons */
.cct-egg-btn {
    background: #E8589A;
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background 0.2s, transform 0.15s;
}
.cct-egg-btn:hover { background: #d0478b; transform: translateY(-2px); }
.cct-egg-btn--secondary {
    background: transparent;
    color: #555577;
    border: 1.5px solid #e4e2f0;
    margin-left: 8px;
}
.cct-egg-btn--secondary:hover { background: #f0eef8; transform: none; }

/* High score ribbon */
#cct-egg-highscore {
    font-size: 0.8125rem;
    color: #8888aa;
    margin-top: 8px;
}
#cct-egg-highscore span { color: #2D3070; font-weight: 600; }

/* Mobile touch hint */
#cct-egg-touch-hint {
    text-align: center;
    font-size: 0.75rem;
    color: #aaaacc;
    padding: 6px 0 8px;
    background: #f0eef8;
    display: none;
}
@media (pointer: coarse) {
    #cct-egg-touch-hint { display: block; }
    #cct-egg-canvas { cursor: default; }
}
