* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Mono', 'Courier New', monospace;
    background: linear-gradient(135deg, #FEEAC9 0%, #FFCDC9 50%, #FDACAC 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, rgba(253, 121, 121, 0.7), transparent);
    border-radius: 50%;
    animation: float-particle 25s infinite ease-in-out;
}

@keyframes float-particle {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% { opacity: 0.9; }
    50% {
        transform: translate(200px, -200px) rotate(180deg) scale(1.8);
        opacity: 1;
    }
    90% { opacity: 0.9; }
}

.falling-heart {
    animation: fallAndFade 3s ease-out forwards;
}

@keyframes fallAndFade {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Start Screen */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #FEEAC9 0%, #FFCDC9 50%, #FDACAC 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.7s ease;
}

.start-container {
    max-width: 700px;
    width: 100%;
    padding: 50px 40px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 25px 70px rgba(253, 121, 121, 0.4);
    text-align: center;
    animation: slideUp 0.8s ease;
}

.start-container h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2.8em;
    color: #8B0000;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1em;
    color: #c92a2a;
    margin-bottom: 35px;
}

.rules-box {
    background: linear-gradient(135deg, #FEEAC9 0%, #FFCDC9 100%);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 35px;
    text-align: left;
    border: 3px solid #FDACAC;
}

.rules-box h3 {
    font-family: 'Orbitron', monospace;
    color: #FD7979;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.rules-box ul {
    list-style: none;
    padding: 0;
}

.rules-box li {
    padding: 10px 0;
    font-size: 1.05em;
    color: #333;
    border-bottom: 1px solid rgba(253, 121, 121, 0.2);
}

.rules-box li:last-child {
    border-bottom: none;
}

.btn-start {
    background: linear-gradient(135deg, #FD7979 0%, #c92a2a 100%);
    color: white;
    padding: 18px 50px;
    font-size: 1.3em;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(253, 121, 121, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.btn-start:hover {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 10px 30px rgba(253, 121, 121, 0.6);
}

/* Game Container */
.container {
    max-width: 950px;
    width: 100%;
    background: white;
    border-radius: 25px;
    box-shadow: 0 25px 70px rgba(253, 121, 121, 0.5);
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: slideUp 0.7s ease-out;
}

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

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

.header {
    background: linear-gradient(135deg, #FFCDC9 0%, #FDACAC 100%);
    padding: 30px;
    text-align: center;
    color: #8B0000;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(254, 234, 201, 0.5) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.header-content {
    position: relative;
    z-index: 1;
}

.header-logos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.logo-left,
.logo-right {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.logo-left svg,
.logo-right svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.header-center {
    flex: 1;
    text-align: center;
}

.header-icons {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 18px;
    font-size: 2.2em;
    color: #FD7979;
}

.header-icons i {
    animation: pulse 2.8s ease-in-out infinite;
}

.header-icons i:nth-child(1) { animation-delay: 0s; }
.header-icons i:nth-child(2) { animation-delay: 0.5s; }
.header-icons i:nth-child(3) { animation-delay: 1s; }

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.3);
        opacity: 1;
    }
}

.header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2.2em;
    margin-bottom: 12px;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.18);
}

.header p {
    font-size: 1.05em;
    opacity: 0.95;
}

.game-container {
    padding: 35px;
}

.level-info {
    text-align: center;
    margin-bottom: 30px;
}

.level-info h2 {
    font-family: 'Orbitron', monospace;
    color: #FD7979;
    font-size: 1.8em;
    margin-bottom: 18px;
    animation: slideInDown 0.6s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.difficulty-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FDACAC 0%, #FD7979 100%);
    color: white;
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 18px;
    box-shadow: 0 5px 15px rgba(253, 121, 121, 0.35);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.stat-item {
    background: linear-gradient(135deg, #FDACAC 0%, #FD7979 100%);
    color: white;
    padding: 12px 22px;
    border-radius: 30px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(253, 121, 121, 0.35);
    font-size: 1em;
}

.stat-item:hover {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 8px 22px rgba(253, 121, 121, 0.45);
}

.hearts-display {
    background: linear-gradient(135deg, #e53e3e 0%, #c92a2a 100%);
}

#heartsContainer {
    display: flex;
    gap: 10px;
}

.heart {
    font-size: 1.4em;
    color: #fff;
    animation: heartBeat 1.8s ease-in-out infinite;
}

.heart.broken {
    color: rgba(255, 255, 255, 0.25);
    animation: none;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.15); }
    20%, 40% { transform: scale(0.95); }
}

@keyframes heartBreak {
    0% { transform: scale(1); }
    25% { transform: scale(1.4) rotate(-12deg); }
    50% { transform: scale(0.7) rotate(12deg); }
    75% { transform: scale(1.3) rotate(-8deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 35px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.image-box {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #FEEAC9 0%, #FFCDC9 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2em;
    color: #FD7979;
    box-shadow: 0 8px 20px rgba(253, 121, 121, 0.3);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 4px solid #FDACAC;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: popIn 0.6s ease;
}

.image-box:nth-child(1) { animation-delay: 0.1s; }
.image-box:nth-child(2) { animation-delay: 0.2s; }
.image-box:nth-child(3) { animation-delay: 0.3s; }
.image-box:nth-child(4) { animation-delay: 0.4s; }

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.4) rotate(-15deg);
    }
    50% {
        transform: scale(1.2) rotate(8deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.image-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(253, 121, 121, 0.35) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-box:hover::before {
    opacity: 1;
}

.image-box:hover {
    transform: scale(1.15) rotate(6deg);
    box-shadow: 0 15px 35px rgba(253, 121, 121, 0.45);
    border-color: #FD7979;
}

.image-box:active {
    transform: scale(0.95);
}

.hint-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #FEEAC9 50%, #FFCDC9 100%);
    border-radius: 18px;
    border: 3px solid #FDACAC;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.7s ease;
}

.hint-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(253, 121, 121, 0.2) 0%, transparent 50%);
    animation: rotate 25s linear infinite;
}

.hint-text {
    font-size: 1.15em;
    color: #8B0000;
    line-height: 1.7;
    position: relative;
    z-index: 1;
    font-weight: 600;
    margin-bottom: 12px;
}

.hint-unlock-status {
    font-size: 0.95em;
    font-weight: bold;
    position: relative;
    z-index: 1;
    margin-top: 12px;
}

.answer-section {
    margin-bottom: 35px;
}

.answer-boxes {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    min-height: 65px;
}

.answer-box {
    width: 46px;
    height: 56px;
    border: 4px solid #FD7979;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7em;
    font-weight: bold;
    color: #FD7979;
    background: white;
    text-transform: uppercase;
    transition: all 0.3s ease;
    animation: bounceIn 0.6s ease;
    font-family: 'Orbitron', monospace;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.2);
    }
    50% {
        transform: scale(1.15);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.answer-box.filled {
    background: linear-gradient(135deg, #FDACAC 0%, #FD7979 100%);
    color: white;
    animation: fillPop 0.5s ease;
    box-shadow: 0 5px 15px rgba(253, 121, 121, 0.45);
}

@keyframes fillPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

.letter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.letter-btn {
    width: 46px;
    height: 46px;
    border: none;
    background: linear-gradient(135deg, #FDACAC 0%, #FD7979 100%);
    color: white;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.28s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(253, 121, 121, 0.35);
    font-family: 'Orbitron', monospace;
}

.letter-btn:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.18);
    box-shadow: 0 8px 18px rgba(253, 121, 121, 0.55);
    background: linear-gradient(135deg, #FD7979 0%, #FDACAC 100%);
}

.letter-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.95);
}

.letter-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    transform: scale(0.8);
}

@keyframes rumble {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px) rotate(-2deg); }
    20%, 40%, 60%, 80% { transform: translateX(3px) rotate(2deg); }
}

@keyframes popBack {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 35px;
    font-size: 1.05em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22);
    font-family: 'Space Mono', monospace;
}

.btn-clear {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-hint {
    background: linear-gradient(135deg, #FEEAC9 0%, #FFCDC9 100%);
    color: #8B0000;
    border: 3px solid #FFCDC9;
}

.btn-hint:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-submit {
    background: linear-gradient(135deg, #FDACAC 0%, #FD7979 100%);
    color: white;
}

.btn-reset {
    background: linear-gradient(135deg, #8B0000 0%, #c92a2a 100%);
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 22px rgba(253, 121, 121, 0.45);
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.fun-fact-section {
    margin-top: 25px;
    padding: 25px;
    background: linear-gradient(135deg, #d4edda 0%, #c3f9cc 100%);
    border-radius: 18px;
    border: 3px solid #28a745;
    animation: slideIn 0.6s ease;
}

.fun-fact-header {
    font-size: 1.3em;
    font-weight: bold;
    color: #155724;
    margin-bottom: 15px;
    font-family: 'Orbitron', monospace;
}

.fun-fact-content {
    font-size: 1.05em;
    color: #155724;
    line-height: 1.7;
}

.message {
    text-align: center;
    padding: 18px;
    border-radius: 15px;
    margin-top: 25px;
    font-weight: bold;
    display: none;
    font-size: 1.15em;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 3px solid #28a745;
    animation: successPulse 0.7s ease;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 3px solid #dc3545;
    animation: shake 0.7s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-15px); }
    20%, 40%, 60%, 80% { transform: translateX(15px); }
}

.message.show {
    display: block;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #FEEAC9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FDACAC 0%, #FD7979 50%, #c92a2a 100%);
    transition: width 0.7s cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: 0 0 15px rgba(253, 121, 121, 0.6);
}

.next-btn {
    display: none;
    margin: 25px auto 0;
    background: linear-gradient(135deg, #FDACAC 0%, #FD7979 100%);
}

.next-btn.show {
    display: flex;
    animation: slideIn 0.6s ease;
}

.completion-screen,
.game-over-screen {
    display: none;
    text-align: center;
    padding: 50px;
    animation: fadeIn 0.8s ease;
}

.completion-screen.show,
.game-over-screen.show {
    display: block;
}

.completion-screen h2 {
    font-family: 'Orbitron', monospace;
    color: #FD7979;
    font-size: 2.8em;
    margin-bottom: 25px;
}

.trophy-icon {
    font-size: 6em;
    margin: 25px 0;
    color: #FD7979;
    animation: bounce 1.4s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

.game-over-screen {
    background: linear-gradient(135deg, rgba(253, 121, 121, 0.15) 0%, rgba(201, 42, 42, 0.15) 100%);
    border-radius: 18px;
    padding: 60px 45px;
}

.game-over-icon {
    font-size: 7em;
    color: #e53e3e;
    margin-bottom: 25px;
}

@keyframes heartBreakBig {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.4) rotate(-18deg); }
    50% { transform: scale(0.7) rotate(18deg); }
    75% { transform: scale(1.3) rotate(-12deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.game-over-title {
    font-family: 'Orbitron', monospace;
    font-size: 3em;
    color: #e53e3e;
    margin-bottom: 18px;
}

.game-over-subtitle {
    font-size: 1.5em;
    color: #c92a2a;
    margin-bottom: 30px;
}

.game-over-stats {
    font-size: 1.3em;
    color: #666;
    margin: 12px 0;
}

.game-over-buttons {
    margin-top: 35px;
}

@media (max-width: 768px) {
    .start-container h1 {
        font-size: 2em;
    }
    
    .rules-box {
        padding: 20px;
    }
    
    .logo-left,
    .logo-right {
        width: 60px;
        height: 60px;
    }
    
    .header h1 {
        font-size: 1.6em;
    }
    
    .header p {
        font-size: 0.9em;
    }

    .game-container {
        padding: 25px;
    }

    .images-grid {
        gap: 12px;
        max-width: 380px;
    }

    .image-box {
        font-size: 2.7em;
    }

    .answer-box {
        width: 40px;
        height: 48px;
        font-size: 1.4em;
    }

    .letter-btn {
        width: 42px;
        height: 42px;
        font-size: 1.2em;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 0.95em;
    }
    
    .game-over-title {
        font-size: 2.2em;
    }
}