/* ============================================================================
   PROYECTO: EL GRINCH - ANIMACIÓN CON CSS3 PURO
   DESARROLLADOR: IMANOL FORBES / INDIESTUDIOX
   DESCRIPCIÓN: Animación navideña utilizando keyframes, flexbox y sombras
   ============================================================================ */

body {
    min-height: 97vh;
    background-color: #3351d8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* ----------------------------------------------------------------------------
   CONTENEDOR DEL PERSONAJE
   ---------------------------------------------------------------------------- */
.character {
    min-width: 300px;
    min-height: 250px;
    background-color: #869fa7;
    border: 20px solid #EEE;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    position: relative;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.turn-to {
    animation-duration: 2.5s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

/* ----------------------------------------------------------------------------
   GORRO DE SANTA (HAT)
   ---------------------------------------------------------------------------- */
.christmas-hat {
    width: 200px;
    height: 150px;
    display: flex;
    align-items: center;
    flex-direction: column;
    position: relative;
    top: 45px;
}

.red-part {
    width: 200px;
    height: 120px;
    background-color: #FF4742;
    box-shadow: inset -10px -11px 0px 11px rgba(0, 0, 0, 0.05);
    border-radius: 100px 100px 0 0;
    animation-name: redAndGreen-shadow;
}

.red-part::before {
    content: "";
    width: 200px;
    height: 120px;
    background-color: #f2433f;
    box-shadow: inset 0 0 0px 100px rgba(0, 0, 0, 0.05);
    border-radius: 100px 100px 10px 10px;
    position: absolute;
    top: 0px;
    z-index: -1;
    animation: shake 1.5s infinite alternate ease-in-out;
}

.white-part {
    width: 220px;
    height: 50px;
    background-color: #EEE;
    box-shadow: inset -4px -6px 0px 4px rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    position: absolute;
    top: 100px;
    animation-name: white-shadow;
}

.white-ball {
    width: 50px;
    height: 50px;
    background-color: #e6e6e6;
    border-radius: 50%;
    position: absolute;
    right: -18px;
    top: 100px;
    z-index: -2;
    animation: shake-white-ball 1.5s infinite alternate ease-in-out;
}

/* ----------------------------------------------------------------------------
   CUERPO Y ROSTRO DEL GRINCH
   ---------------------------------------------------------------------------- */
.grinch {
    width: 200px;
    height: 280px;
    background-color: #86c92c;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: inset 10px -11px 0px 11px rgba(0, 0, 0, 0.05);
    position: relative;
    top: -45px;
    z-index: -1;
    display: flex;
    justify-content: center;
    animation-name: redAndGreen-shadow;
}

.grinch .eye {
    width: 50px;
    height: 25px;
    background-color: #e8fecc;
    border-radius: 100px 100px 0 0;
    margin: 0 19px;
    position: relative;
    bottom: -100px;
    overflow: hidden;
    transform: rotate(180deg);
    animation-name: move-eyes;
}

.grinch .eye .pupil {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #19235b;
    position: absolute;
    bottom: -8px;
    animation-name: move-pupil;
}

.grinch .nose {
    width: 30px;
    height: 30px;
    border-radius: 20% 20% 50%;
    transform: rotate(45deg);
    background-color: #19235b;
    position: absolute;
    bottom: 125px;
    animation-name: move-nose;
}

/* ----------------------------------------------------------------------------
   TITULO Y TEXTO
   ---------------------------------------------------------------------------- */
.name {
    font-family: 'Rock Salt', Arial, Helvetica, sans-serif;
    font-size: 2.2em;
    color: #86c92c;
    margin-top: 10px;
    text-shadow: 0 2px #e8fecc, 2px 0 #e8fecc, 0 -2px #e8fecc, -2px 0 #e8fecc, 
                 -2px 2px #e8fecc, 2px -2px #e8fecc, 2px 2px #e8fecc, -2px -2px #e8fecc;
}

/* ----------------------------------------------------------------------------
   KEYFRAMES DE ANIMACIÓN CSS
   ---------------------------------------------------------------------------- */
@keyframes shake {
    from {
        transform: translateX(10px) rotate(-7deg);
    }
    50% {
        transform: translateY(4px);
    }
    to {
        transform: translateX(-5px) rotate(5deg);
    }
}

@keyframes shake-white-ball {
    from {
        transform: translateX(20px);
    }
    to {
        transform: translateX(-200px);
    }
}

@keyframes redAndGreen-shadow {
    from {
        box-shadow: inset 10px -11px 0px 11px rgba(0, 0, 0, 0.05);
    }
    25%, 50% {
        box-shadow: inset -10px -11px 0px 11px rgba(0, 0, 0, 0.05);
    }
    75%, 100% {
        box-shadow: inset 10px -11px 0px 11px rgba(0, 0, 0, 0.05);
    }
}

@keyframes white-shadow {
    from {
        box-shadow: inset 4px -6px 0px 4px rgba(0, 0, 0, 0.05);
    }
    25%, 50% {
        box-shadow: inset -4px -6px 0px 4px rgba(0, 0, 0, 0.05);
    }
    75%, 100% {
        box-shadow: inset 4px -6px 0px 4px rgba(0, 0, 0, 0.05);
    }
}

@keyframes move-pupil {
    from {
        left: 0;
    }
    25%, 50% {
        left: 30px;
    }
    75%, 100% {
        left: 0;
    }
}

@keyframes move-eyes {
    from {
        transform: rotate(180deg) translateX(-15px);
    }
    25%, 50% {
        transform: rotate(180deg) translateX(15px);
    }
    75%, 100% {
        transform: rotate(180deg) translateX(-15px);
    }
}

@keyframes move-nose {
    from {
        transform: translateX(15px) rotate(45deg);
    }
    25%, 50% {
        transform: translateX(-15px) rotate(45deg);
    }
    75%, 100% {
        transform: translateX(15px) rotate(45deg);
    }
}

/* ============================================================================
   FASE 1: EL CORAZÓN DEL GRINCH & CONTROLES EDITORIALES INTERACTIVOS
   ============================================================================ */
.heart {
    width: 26px;
    height: 26px;
    background-color: #FF4742;
    position: absolute;
    bottom: 60px;
    right: 48px;
    transform: rotate(-45deg);
    box-shadow: 0 0 12px rgba(255, 71, 66, 0.6);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    cursor: pointer;
    animation: heartbeat 1.8s infinite ease-in-out;
    z-index: 5;
}

.heart::before,
.heart::after {
    content: "";
    width: 26px;
    height: 26px;
    background-color: #FF4742;
    border-radius: 50%;
    position: absolute;
}

.heart::before {
    top: -13px;
    left: 0;
}

.heart::after {
    top: 0;
    right: -13px;
}

/* Escalas del corazón (1x, 2x, 3x) */
.heart.size-1 {
    transform: scale(0.9) rotate(-45deg);
    box-shadow: 0 0 10px rgba(255, 71, 66, 0.5);
}

.heart.size-2 {
    transform: scale(1.6) rotate(-45deg);
    box-shadow: 0 0 22px #FF4742, 0 0 40px rgba(255, 71, 66, 0.8);
}

.heart.size-3 {
    transform: scale(2.4) rotate(-45deg);
    box-shadow: 0 0 35px #FF4742, 0 0 65px #FF0000, 0 0 100px #FF4742;
    animation: heartbeat-fast 0.8s infinite ease-in-out;
}

/* Panel de control estilo Hallmark / Industrial Editorial */
.heart-controls {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.heart-button {
    background-color: #14171E;
    color: #00F090;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
    font-weight: bold;
    padding: 10px 20px;
    border: 2px solid #00F090;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 240, 144, 0.25);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.heart-button:hover {
    background-color: #00F090;
    color: #14171E;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 144, 0.45);
}

.heart-status {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78em;
    color: #EEE;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0.5px;
}

.heart-status span {
    color: #FF4742;
    font-weight: bold;
    transition: color 0.3s ease;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(0.9) rotate(-45deg);
    }
    15% {
        transform: scale(1.05) rotate(-45deg);
    }
    30% {
        transform: scale(0.9) rotate(-45deg);
    }
}

@keyframes heartbeat-fast {
    0%, 100% {
        transform: scale(2.4) rotate(-45deg);
    }
    15% {
        transform: scale(2.75) rotate(-45deg);
    }
    30% {
        transform: scale(2.4) rotate(-45deg);
    }
}

/* ============================================================================
   FASE 2: EFECTO DE NIEVE INVERNAL (SNOWFALL CSS3 KEYFRAMES)
   ============================================================================ */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    transition: opacity 0.6s ease;
}

.snowflake {
    position: absolute;
    top: -20px;
    color: #FFFFFF;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
    user-select: none;
    animation-name: snowfall, sway;
    animation-iteration-count: infinite, infinite;
    animation-timing-function: linear, ease-in-out;
}

@keyframes snowfall {
    0% {
        top: -20px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.85;
    }
    100% {
        top: 102vh;
        opacity: 0;
    }
}

@keyframes sway {
    0%, 100% {
        transform: translateX(0px);
    }
    50% {
        transform: translateX(35px);
    }
}

.controls-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.snow-button {
    background-color: #14171E;
    color: #00F0FF;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.88em;
    font-weight: bold;
    padding: 10px 18px;
    border: 2px solid #00F0FF;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.25);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.snow-button:hover {
    background-color: #00F0FF;
    color: #14171E;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.45);
}

/* ============================================================================
   FASE 2 / 3: GLOBO DE DIÁLOGO INTERACTIVO CON FRASES CÉLEBRES DEL GRINCH
   ============================================================================ */
.speech-bubble {
    position: absolute;
    top: 12px;
    right: -55px;
    max-width: 230px;
    background-color: #FFFFFF;
    color: #14171E;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 0.86em;
    line-height: 1.38;
    padding: 12px 16px;
    border: 3px solid #14171E;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    z-index: 20;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    animation: popBubble 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.speech-bubble::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 45px;
    border-width: 15px 15px 0;
    border-style: solid;
    border-color: #FFFFFF transparent;
    display: block;
    width: 0;
    filter: drop-shadow(0 3px 0 #14171E);
}

.speech-bubble:hover {
    transform: scale(1.06) rotate(1deg);
}

@keyframes popBubble {
    0% {
        transform: scale(0.6) translateY(10px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.quote-button {
    background-color: #14171E;
    color: #FFDE00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.88em;
    font-weight: bold;
    padding: 10px 18px;
    border: 2px solid #FFDE00;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(255, 222, 0, 0.25);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.quote-button:hover {
    background-color: #FFDE00;
    color: #14171E;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 222, 0, 0.45);
}

/* ============================================================================
   FASE 5: MARCO EDITORIAL DE PORTAFOLIO (HALLMARK CRAFT FRAME)
   ============================================================================ */
.hallmark-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(20, 23, 30, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.hallmark-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.badge {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.76em;
    font-weight: bold;
    letter-spacing: 0.8px;
    padding: 6px 14px;
    border-radius: 6px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.badge-dark {
    background: #14171E;
    color: #EEE;
    border: 1px solid #3d4352;
}

.badge-blue {
    background: #1572B6;
    color: #FFF;
    border: 1px solid #3695db;
}

.badge-green {
    background: #00F090;
    color: #14171E;
    border: 1px solid #00F090;
    font-weight: 800;
}

.badge-yellow {
    background: #FFDE00;
    color: #14171E;
    border: 1px solid #FFDE00;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badge-yellow:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255, 222, 0, 0.5);
    background: #ffe633;
}

body {
    padding-top: 55px;
}

@media (max-width: 600px) {
    .badge {
        font-size: 0.65em;
        padding: 4px 8px;
    }
    .hallmark-header {
        padding: 8px 10px;
    }
}